aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Core Java (GATE - CS)
  • Which of the following options are correct? interface Pet...
Multiple choice

Which of the following options are correct? interface Pet { } class Dog implements Pet { } public class Beagle extends Dog{ }

  1. Pet a = new dog();

  2. Beagle c = new dog();

  3. Pet e = new Beagle();

  4. Pet b = new Pet();

  5. Both 1 and 3

Reveal answer Fill a bubble to check yourself
E Correct answer
Explanation

Both options 1 and 3 are correct. So, this is the correct choice.

Keep practicing — related questions

  • Given: 1. class Dog { } 2. class Beagle extends Dog { } 3. 4. class Kennel { 5. public static void main(Str...
  • Given: public abstract interface Frobnicate { public void twiddle(String s) ; } Which is a correct class? (...
  • Given: 10. interface Data { public void load(); } 11. abstract class Info { public abstract void load(); } ...
  • 1. class Dog { } 2. class Beagle extends Dog { } 3. 4. class Kennel { 5. public static void main(String [] ...
  • interface <interface name> extends <interface name1>Is correct???
  • Given: 11. class ClassA {} 12. class ClassB extends ClassA {} 13. class ClassC extends ClassA {} and: 21. C...
  • Given: 1. public interface A { 2. String DEFAULT_GREETING = “Hello World”; 3. public void method1(); 4. } A...
  • What is true from the following?
Play the full quiz 🎤 Practise this topic out loud

Practice this topic

  • Object-Oriented Programming (2239 questions)
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy