Answer Posted / guest
The wrapper classes can take constructors of either the
type they are designed to wrap or of a String that can be
converted to that type. Thus the Integer class can take a
number that could be contained by an int, but an error will
occur if you try to pass a number with a floating point
component. Remember that the wrapper classes are just that
classes, they are not primitives and instances of the
wrappers can only be manipulated in the same way as any
class. You may get questions on the exam with code that
uses standard math operations to manipulate instances of
wrappers. You can of course use the + operator where it
would implicitly call the toString method, but as soon as
you see the - * or % operator, beware.
| Is This Answer Correct ? | 7 Yes | 8 No |
Post New Answer View All Answers
Is finalize() similar to a destructor?
Difference between final and effectively final ? Why is effectively final even required ?
What is anonymous inner class?
What is abstract class constructor called?
Where can I find jdk in my computer?
Is java se free?
How dead lock situation occurs in java and how you can identify it?
Is 9 a prime number?
What is the type of lambda expression?
Where are the local variables stored?
What if constructor is protected in java?
Explain why wait(), notify() and notifyall() methods are in object class rather than in the reading class?
What are the advantages of java over C++?
Explain reverse a linked list recursive java solution?
Why we override equals() method?