Abstract Classes and Implementing Interfaces

Abstract Classes and Implementing Interfaces

9 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

The class String is defined in the package ___________.

  1. java.awt
  2. java.lang
  3. java.math
  4. java.net
Question 2 Multiple Choice (Single Answer)

Which of the following interfaces enables you to work with a group of objects?

  1. Collection
  2. List
  3. Set
  4. SortedSet
  5. SecurityManager
Question 3 Multiple Choice (Single Answer)

An abstract class cannot be _____________ in Java.

  1. declared
  2. defined
  3. instantiated
  4. inherited
Question 4 Multiple Choice (Single Answer)

The method within the abstract class must be _________.

  1. static
  2. final
  3. constant
  4. abstract
Question 5 Multiple Choice (Single Answer)

Which of the following is not an interface of Java Collection Framework?

  1. Set
  2. List
  3. Queue
  4. HashSet
Question 6 Multiple Choice (Single Answer)

Which of the following classes offers all the benefits of an array with the properties of the List interface?

  1. LinkedList
  2. ArrayList
  3. TreeSet
  4. HashMap
Question 7 Multiple Choice (Single Answer)

Which of the following is false regarding interface in Java?

  1. An interface can have only abstract methods.
  2. Constructors cannot be present in an interface.
  3. An interface can have instance variables.
  4. An interface cannot have static methods.
  5. A class can implement multiple interfaces.
Question 8 Multiple Choice (Single Answer)

Which of the following interfaces in java.beans package allows designers to change and display property value?

  1. DesignMode
  2. PropertyChangeListener
  3. PropertyEditor
  4. Visibility
  5. BeanInfo
Question 9 Multiple Choice (Single Answer)

In Java _________ is a interface.

  1. Map
  2. HashMap
  3. HashTable
  4. Table
  5. Arrays