Computer Applications
Name the wrapper classes of char type and long type
Java Library Classes
1 Like
Answer
Wrapper class of char is Character and long is Long.
Answered By
2 Likes
Related Questions
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.
The method to convert a String to double is:
- String.toDouble()
- Double.Parsedouble()
- Double.parseDouble(String)
- Double.parseDouble()
Give the output of the following code:
String P = "20", Q ="19"; int a = Integer.parseInt(P); int b = Integer.valueOf(Q); System.out.println(a+""+b);Predict the output of the following code snippet:
char ch='B', char chr=Character.toLowerCase(ch); int n=(int)chr-10; System.out.println((char)n+"\t"+chr);