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

Which is best ide for java?

523


What is Hierarchy of exception?

647


What are the differences between graph and tree?

647


How can we achieve thread safety in java?

685


What is an example of a conditional statement?

564






What is the nested interface?

599


What is a variable analysis?

642


How do you use wildcards?

536


What is an accessor?

1053


What is the advantage of OOP in java?

661


whatis Home interface and Remoteinterface? with example?

1551


What is Garbage Collection in Java

611


If a method is declared as protected, where may the method be accessed?

534


Why java is object oriented?

592


Write a code to create a trigger to call a stored procedure

535