GoConqr has a new look! Let us know what you think.

Quiz

Java Exam 2 Prep

Eric Brletic 56 questions

Take the quiz

Questions in this quiz (56)

  1. 1An abstract class may contain instance fields, but an interface can't have any instance fields (variables).
    1. ATrue
    2. BFalse
  2. 2An abstract class needs to have at-least one abstract method.
    1. ATrue
    2. BFalse
  3. 3An abstract method cannot be placed in a non-abstract class.
    1. ATrue
    2. BFalse
  4. 4An abstract class cannot be instantiated, but any class extending an abstract class can be instantiated.
    1. ATrue
    2. BFalse
  5. 5A class extending an abstract class needs to implement every abstract method in the abstract class. However, overriding non-abstract methods of the abstract class is optional.
    1. ATrue
    2. BFalse
  6. 6Although an abstract class cannot be instantiated, but it can have constructors.
    1. ATrue
    2. BFalse
  7. 7An interface in Java can have both method declarations and method implementations.
    1. ATrue
    2. BFalse
  8. 8A Java class can implement multiple interfaces.
    1. ATrue
    2. BFalse
  9. 9In Java, can an interface have variables (fields)?
    1. ANo, interfaces can only have methods
    2. BYes, but the variables must be static and final
    3. CYes, interfaces can have instance variables
    4. DYes, but variables in an interface are automatically initialized
  10. 10In Java, a class can extend both another class and implement one or more interfaces.
    1. ATrue
    2. BFalse

Information

Description
Computer Science Quiz on Java Exam 2 Prep, created by Eric Brletic on 02/11/2023.
Language
English
Views
15
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?