Which three code fragments can be independently inserted at line nl to enable the code to print one?

Given the code fragment: Which three code fragments can be independently inserted at line
nl to enable the code to print one?

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;



Leave a Reply 4

Your email address will not be published. Required fields are marked *


Kaykay

Kaykay

Definitely B,E,F.

Tomas

Tomas

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;