NEW
Font size
WorksheetsWrapper Class
Total questions: 25
Worksheet time: 13mins
Wrapper classes are found in _____ package
java.lang
java.util
java.io
java.net
The data type wrapper classes are in……….package
java.lang
java.io
java.util
java.applet
Which of these is a wrapper for data type int?
Integer
Long
Byte
Double
Which of these is a super class of wrappers Long, Character & Integer?
Long
Digits
Float
Number
Which of these is a wrapper for simple data type char?
Float
Character
String
Integer
Which of the following is method of wrapper Integer for converting the value of an object into int?
bytevalue()
int intValue();
Bytevalue()
Byte Bytevalue()
Which of these methods is used to obtain value of invoking object as a long?
long value()
long longValue()
Long longvalue()
Long Longvalue()
Consider the following two statements
int x = 25;
Integer y = new Integer(33);
What is the difference between these two statements?
Primitive data types
primitive data type and an object of a wrapper class
Wrapper class
None of the above
Where does the primitive data type values be stored?
Heap Memory
Stack Memory
Both A & B
None of the above
Converts string "24" into integer and stores it in integer variable n
int n=Integer.parseInt("24");
int n=Integer.ParseInt("24");
Integer.parseInt("24");
int n=integer.parseInt("24");
Converts string "24" into integer and stores it in integer variable n
int n=Integer.parseInt("24");
int n=Integer.ParseInt("24");
Integer.parseInt("24");
int n=integer.parseInt("24");
State True or False;A data type starts with lowercase letter whereas its wrapper class starts with an upper case letter
True
false
what is the value of n here; double n=Double.valueOf("24.31546")
"24.31546"
Number Format error
24.31546
24
I want to convert integer n to string s, I will use
Integer.valueOf(s);
s=Integer.toString()
n=integer.parseInt(s)
s=Integer.toString(n)
Syntax to get character from user is
char ch=sc.nextchar();
ch=sc.nextChar();
char ch=in.next().charAt(0);
char ch=in.next().charAt();
state which statements are true
String data type char along with all the functions related to character manipulations belong to Character wrapper class.Hence,the character oriented functions start with keyword Character.
Primitive data type char along with all the functions related to character manipulations belong to String wrapper class.Hence,the character oriented functions start with keyword String.
Primitive data type char along with all the functions related to character manipulations belong to Character wrapper class.Hence,the character oriented functions start with keyword Character.
All the above
What is the return type of the snippet, Character.isLetterOrDigit("*");
None
False
true
boolean
The snippet to check existing blank or gap in a string.
boolean b=Character.iswhitespace(character);
boolean b=Character.isWhitespace(character);
boolean b=character.isWhitespace(character);
Character.isWhitespace(character);
which is correct statement
boolean c= Character.toLowerCase('G');
char c= Character.ToLowerCase('G');
Boolean c= Character.toLowerCase('G');
char c= Character.toLowerCase('G');
Which is correct statement
boolean b=Character.isLetterOrDigit('9');
boolean b=character.isLetterOrDigit('9');
boolean b=Character.IsLetterOrDigit('9');
boolean b=Character.isLetterorDigit('9');
What will be output of x and y if , String s= "1001";int x=Integer.valueOf(s);double y=Double.valueOf(s);
x="1001";y=1001
x="1001";y=1001.0
x=1001;y=1001.0
x=1001.o;y=1001
State a method that converts string to primitive float data type
Float.parseString(String);
Float.parsefloat(String);
float.parseFloat(String);
Float.parseFloat(String);
State the values of n and ch;char c='A'; int n=c+1;char ch=(char)n;
n=6 ; ch=B
n=66 ; ch=B
n=6 ; ch=b
n=96 ; ch=b
