Given the code fragment: Which three code fragments can be independently inserted at line
nl to enable the code to print one?
A.
Double x = 1;
B.
Integer x = new Integer (“1”);
C.
Long x = 1;
D.
String x = “1”;
E.
short x = 1;
F.
Byte x = 1;
Given the code fragment: Which three code fragments can be independently inserted at line
nl to enable the code to print one?
A.
Double x = 1;
B.
Integer x = new Integer (“1”);
C.
Long x = 1;
D.
String x = “1”;
E.
short x = 1;
F.
Byte x = 1;
b, e, f
Definitely B,E,F.
Answers: B, E, F
// A – ERROR
//Double x = 1;
// B – OK
//Integer x = new Integer(“1”);
// C – ERROR
//Long x = 1;
// D – ERROR
//String x = “1”;
// E – OK
//short x = 1;
// F – OK
//Byte x = 1;
b,e.f