why the primitive data type have classes?

Answer Posted / aditya mohata

These classes are Wrapper classes.We hav them as we cant
pass an primitive directly through an method to different
class.So we need wrapper classes to convert them to their
already defined classes.Send them n again unpack them.

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does list work in java?

695


Compare overloading and overriding?

776


What is the use of optional ?

786


Can we have return statement in finally clause? What will happen?

731


Can inner class extend any class?

804


Can we instantiate interface in java?

896


What is difference between core java and java ee?

669


What is tree in java?

670


Which collections are thread safe in java?

692


when you will synchronize a piece of your code? : Java thread

755


Is string an object?

869


Can a method be static?

730


What are the advantages of inner classes?

730


What is multithreading in java?

777


What's the default access specifier for variables and methods of a class?

764