Question: QUESTION 1 When using wrapper classes, it is always necessary to explicity covert between the wrapper class and the corresponding primitive data type. True False

QUESTION 1
When using wrapper classes, it is always necessary to explicity covert between the wrapper class and the corresponding primitive data type.
True
False
6 points
QUESTION 2
Before we can use a JOptionPane, it is necessary to instantiate an object of that class.
True
False
6 points
QUESTION 3
It is not necessary to use an import statement when using the JOptionPane class in our code.
True
False
6 points
QUESTION 4
The showMessageDialog static method of the JOptionPane class will create a pop-up that will prompt a user for input.
True
False
6 points
QUESTION 5
Which of the following (choose all correct answers) are wrapper classes?
String
int
Byte
DrDre
Boolean
Integer
double
16 points
QUESTION 6
What (if anything) is the value of the variabl num1 after the execution of the following code:
Double d1= new Double(33.72);
Integer i1=17;
double num1=(int)(d1+ i1);
50.0
The code example contains an error and will not run.
50
50.72
16 points
QUESTION 7
Which of the following JOptionPane methods is used to display a pop-up dialog box with a displayed message?
showConfirmDialog
showMessageDialog
showInternalConfirmDialog
showInputDialog
16 points
QUESTION 8
What (if anything) is wrong with the following Java code:
Integer i =37;
int x = i.valueOf("37");
The valueOf method is static and should be called on the Integer class itself.
There is nothing wrong with the above code.
An Integer object cannot be assigned a literal iteger value and the constructor must be used.
The valueOf method does not take any arguments, so it not possible to call the method this way.
16 points
QUESTION 9
Which of the following statements would convert a String variable number1 into an int type:
Integer.valueOf(number1);
number1.valueOf();
Integer.parseInt(number1);
number1.parseInt();
int.valueOf(number1);
int.parseInt(number1);
16 points
QUESTION 10
Assigning a primitive value to a Wrapper class results in automatic conversion called what:
Autoboxing
Steven
Shadowboxing
Unboxing

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!