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
What does index mean in java?
What is ‘has a’’ relationship in java?
What do you mean by collectors in java 8?
What is number data type?
What is boolean false?
What is unsigned char?
How do you create a first line indent?
What does this () mean in constructor chaining concept?
Difference between class#getinstance() and new operator ?
What are the different types of multitasking?
Write a program in java to calculate the difference between the sum of the odd level and even level nodes of a binary tree.
Do I need to import java.lang package any time? Why?
What is java and their uses?
Difference between static synchronization vs. Instance synchronization?
what is anonymous class in java?