πŸ“Š JAVA
Q. Given the following piece of code:
public interface Guard{
void doYourJob();
}
abstract public class Dog implements Guard{ }

which of the following statements is correct?
  • (A) This code will not compile, because method doYourJob() in interface Guard must be defined abstract.
  • (B) When it doesn't make sense to have objects of that class.
  • (C) This code will not compile, because in the declaration of class Dog we must use the keyword extends instead of implements.
  • (D) This code will compile without any errors.
πŸ’¬ Discuss
βœ… Correct Answer: (D) This code will compile without any errors.

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
82
Total Visits
πŸ“½οΈ
11 mo ago
Published
πŸŽ–οΈ
Sonali Mishra
Publisher
πŸ“ˆ
92%
Success Rate