?
Solved

wrapper class

Posted on 2011-04-26
3
Medium Priority
?
308 Views
Last Modified: 2012-05-11
>>Which of the following statements are true?

1) The Integer class has a String and an int constructor
2) The Integer has a floatValue() method
3) The wrapper classes are contained in the java.lang.Math package
4) The Double class has constructors for type double and float


Answer to Question 1

1) The Integer class has a String and an int constructor
2) The Integer has a floatValue() method
4) The Double class has constructors for type double and float

i was going through above question from following link

http://www.jchq.net/certkey/0803certkey.htm

It is not clear to me.

Can Integer class can take String argument.

Any ideas, resources, links, sample code highly appreciated. thanks in advance.
Tags:
0
Comment
Question by:gudii9
3 Comments
 
LVL 47

Accepted Solution

by:
for_yan earned 1000 total points
ID: 35471936
Integer class of course has constructor which takes Striing
as an argument


String s = "25;

Integer ii = new Integere(s);

System.out.println("integer =" ii.intValue());

It will print

 integer = 25
0
 
LVL 92

Assisted Solution

by:objects
objects earned 600 total points
ID: 35471975
> Can Integer class can take String argument.


yes it can http://download.oracle.com/javase/6/docs/api/java/lang/Integer.html#Integer(java.lang.String)
" Constructs a newly allocated Integer object that represents the int value indicated by the String parameter."
0
 
LVL 20

Assisted Solution

by:Sathish David Kumar N
Sathish David  Kumar N earned 400 total points
ID: 35473172
It working like an object .. so what ever object (string is also object ) so it will take ...

as per my understanding ...
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
A solution for Fortify Path Manipulation.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses
Course of the Month16 days, 11 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question