Which of the following is a correct interface?

a. interface A { void print() { }; }
b. abstract interface A { print(); }
c. abstract interface A { abstract void print() { };}
d. interface A { void print();}


d In A, the print() method in the interface is a concrete method. In B and C, the abstract keyword is used before the interface, which is wrong. The correct answer is D.

Computer Science & Information Technology

You might also like to view...

The ____ flag in the placeholder of a format-string passed to printf() causes a variable to be left-justified within its field.

A. - B. + C. 0 D. l

Computer Science & Information Technology

The X.25 standard uses which protocol at the Frame Level?

a. V.24 b. LAP-B c. X.3 d. none of the above

Computer Science & Information Technology

Toyota recalled 133,000 Prius hybrid automobiles in the United States in March 2010 because of a ____ problem with the braking system.

A. software B. hardware C. firmware D. malware

Computer Science & Information Technology

If you wish to prevent a page break from occurring within a paragraph use the ________ pagination command

A) Page break before B) widow/orphan control C) Keep with next D) Keep lines together

Computer Science & Information Technology