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
Why main method is called first in java?
Does treeset allow null in java?
What is parseint?
Can You Have Virtual Functions In Java?
How to display all the prime numbers between 1 and 100
What are different exception types exceptions available in java ?
How does compareto method work?
How many bytes is double?
Differences between traditional programming language and object oriented programming language?
What does java se mean?
What is the difference between private & public & friendly classes?
What is the benefit of lambda expressions?
What is exception handling in java?
Do extraneous variables affect validity?
Can we use different return types for methods when overridden?