Given the following piece of code: public interface Guard{void doYourJob(); } abstract public class Dog implements Guard{ } which of the following statements is correct?

Question:
Given the following piece of code: public interface Guard{void doYourJob(); } abstract public class Dog implements Guard{ } which of the following statements is correct?

1.This code will not compile, because in the declaration of class Dog we must use the keyword extends instead of implements.

2.This code will compile without any errors.

3.This code will not compile, because class Dog must implement method doYourJob() from interface Guard.

4.This code will not compile, because method doYourJob() in interface Guard must be defined abstract.

Posted Date:-2021-10-25 05:37:20


More MCQS Questions and answers

Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!