What are wrapper classes?

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


Please Help Members By Posting Answers For Below Questions

What does index mean in java?

747


What is ‘has a’’ relationship in java?

954


What do you mean by collectors in java 8?

734


What is number data type?

773


What is boolean false?

742


What is unsigned char?

843


How do you create a first line indent?

740


What does this () mean in constructor chaining concept?

823


Difference between class#getinstance() and new operator ?

887


What are the different types of multitasking?

857


Write a program in java to calculate the difference between the sum of the odd level and even level nodes of a binary tree.

759


Do I need to import java.lang package any time? Why?

1053


What is java and their uses?

776


Difference between static synchronization vs. Instance synchronization?

833


what is anonymous class in java?

763