KnowledgeBoat Logo

Computer Applications

Java language uses each primitive data type under a specific packet. Other than a data type, the packet also contains the functions to convert the primitive type into string and vice versa. The computer uses 128 ASCII characters. Each character is assigned a specific numeric code called ASCII code. Java language also has the facility to convert the characters into the ASCII code and vice versa.

Based on the above discussion, answer the following questions:

(a) What is the name given to the packet containing a primitive data type?

(b) What is the function used to convert a string data into integer type?

(c) Name the term used to convert a primitive data into the object of its wrapper class.

(d) What is the syntax to convert a string "24" into integer data type?

Java Library Classes

25 Likes

Answer

(a) Wrapper class

(b) parseInt() or valueOf()

(c) Autoboxing

(d) int num = Integer.valueOf("24");

Answered By

17 Likes


Related Questions