Summer Special Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: exc65

Identify two features of Java.

A.

architecture dependent

B.

platform independent

C.

single threaded

D.

robust

Given:

What is the result?

A.

The code fails to compile. To make it compile, at line n1 insert:

this () { }

B.

The code fails to compile. To make it compile, at line n2 insert:

this ();

C.

The code fails to compile. To make it compile, at line n1 insert:

Bus () { }

D.

The code compiles and prints:

default

luxury

Given the code fragment:

What is the result?

A.

10

B.

11

C.

12

D.

13

Given the code fragment:

What is the result?

A.

25.67

B.

25.00

C.

25.7

D.

26

Given:

What is the result?

A.

Compilation fails. To make it compile, replace line n1 with var1 = 0;

B.

Compilation fails. To make it compile, replace line n2 with var2 = 0;

C.

0

D.

Nothing is printed.

Given the classes:

Which two modifications, independently, enable the Salad.java file to compile?

A.

Replace line n1 with import fruits.Apple.getApple();

B.

Replace line n1 with import fruits.Apple;

C.

Replace line n1 with import fruits;

D.

Replace line n2 with fruits.Apple apple = new Apple ();

E.

Replace line n2 with fruits.Apple apple = new fruits.Apple ();

Given the code fragment:

Which code fragment, when inserted at line n1, enables it to print Rita is 14 years old?

A.

System.out.println(“%s is %d years old” +name+age);

B.

System.out.println(“%s is %n years old” name, age);

C.

System.out.printf(“%s is %d years old”, name, age);

D.

System.out.printf(“%s is %n years old”, name, age);

Given the code fragment:

What is the result?

A.

3

B.

A compilation error occurs.

C.

2

D.

0

Given:

Which statement, when inserted at line n1, enables the Course class to compile?

A.

int newFee;

B.

double newFee;

C.

long newFee;

D.

float newFee;

Which statement is true about primitive variables?

A.

They can be compared with the == operator.

B.

They can be compared with the equals method only.

C.

They cannot be compared.

D.

They can be compared with the compareTo method only.