Computer Applications
What is Autoboxing in Java? Give an example.
Java Library Classes
16 Likes
Answer
The automatic conversion of primitive data type into an object of its equivalent wrapper class is known as Autoboxing. For example, the below statement shows the conversion of an int to an Integer.
Integer a = 20;
Answered By
6 Likes
Related Questions
What is the method to check whether a character is a letter or digit?
- isDigit(char)
- isLetterOrDigit()
- isLetterOrDigit(char)
- isLETTERorDIGIT(char)
Primitive data types are built in data types which are a part of the wrapper classes. These wrapper classes are encapsulated in the java.lang package. Non primitive datatypes like Scanner class are a part of the utility package for which an object needs to be created.
(a) To which package the Character and Boolean classes belong?
(b) Write the statement to access the Scanner class in the program.