Return to site

JAVA CERTIFICATION QUESTION: Abstract methods of concrete classes in Java

· java,ocp

All the abstract methods inherited by a concrete class must have concrete implementations, or the code cannot compile.

Given the following code:

 

Which fragments added simultaneously at line n1 allow the following two lines of code to compile and run? Choose two.

Novel n = new Novel();

n.spellCheck();

 

A. public void spellCheck() throws Exception { }

B. String getContent() { return "Novel"; }

C. public String getContent() { return "Novel"; }

D. public void setAuthor(String a) { }

E. public void setContent(String txt) { }

 

 

 

·Ǝ puɐ ꓷ suoᴉʇdo ǝɹɐ sɹǝʍsuɐ ʇɔǝɹɹoɔ ǝɥꓕ