Java Object-Oriented Programming

About the Fundamental Concept of Object-Oriented-Programming in Java

21 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

OOP promotes a way of programming that allows programmers to think in terms of:

  1. Data
  2. Procedures
  3. Objects
  4. Orientation
Question 2 Multiple Choice (Single Answer)

What Java keyword do you use to define a class?

  1. define
  2. super
  3. extend
  4. class
Question 3 Multiple Choice (Single Answer)

A procedure in a class that describes an action that an object can perform is called

  1. Method
  2. Function
  3. Procedure
  4. Property
Question 4 Multiple Choice (Single Answer)

A member function

  1. is always public
  2. is always private
  3. can be public or private
  4. cannot be defined
Question 5 Multiple Choice (Single Answer)

Constructors are used to

  1. To build a user interface
  2. To initialize a newly created object
  3. To free memory
  4. to create a sub class
Question 6 Multiple Choice (Single Answer)

Access to an object only through its member functions, while keeping the details private is

  1. Mudularity
  2. Inheritance
  3. Encapsulation
  4. Polymorphism
Question 7 Multiple Choice (Single Answer)

Can objects of abstract classes be instantiated

  1. Yes
  2. No
  3. Maybe
  4. If you force enough
Question 8 Multiple Choice (Single Answer)

Pick the term that relates to polymorphism

  1. Dynamic Binding
  2. Dynamic Allocation
  3. Static Typing
  4. Static Allocation
Question 9 Multiple Choice (Single Answer)

Two or more methods with same name in the same class with different arguments is called as

  1. Method Overriding
  2. Method Overloading
  3. Method Overbooking
  4. Method Overestimating
Question 10 Multiple Choice (Single Answer)

An object that has more than one form is referred to as

  1. Inheritance
  2. Interface
  3. Polymorphism
  4. Abstraction
Question 11 Multiple Choice (Single Answer)

A blueprint of an object is referred to as a ______.

  1. Method
  2. Function
  3. Property
  4. Class
Question 12 Multiple Choice (Single Answer)

Keyword which is used to access the method or member variables from the parent class is:

  1. import
  2. using
  3. is_a
  4. super
Question 13 Multiple Choice (Single Answer)

When subclass declares a method that has the same arguments as declared by its superclass

  1. Method Overloading
  2. Operator Overloading
  3. Method Overrriding
  4. Operator Overriding
Question 14 Multiple Choice (Single Answer)

Main method can be overriden

  1. Yes
  2. No
  3. Sometimes
  4. with brute force
Question 15 Multiple Choice (Single Answer)

Constructors never have an explicit return type

  1. True
  2. False
Question 16 Multiple Choice (Single Answer)

Which of the following is not a part of OOP?

  1. Type Checking
  2. Polymorphism
  3. Multithreading
  4. Encapsulation
Question 17 Multiple Choice (Single Answer)

What are the two common characteristics shared by all objects?

  1. Methods and interfaces
  2. State and behavior
  3. Methods and messages
Question 18 Multiple Choice (Single Answer)

What really happens when a message is sent to an object?

  1. A method is called on that object
  2. A member variable is set for that object
  3. A text string is assigned to the object.
Question 19 Multiple Choice (Single Answer)

When a class is based on another class, it inherits:

  1. The data and methods for the class
  2. The methods and messages for the class
  3. Only the data for the class
Question 20 Multiple Choice (Single Answer)

Inheritance is a way to

  1. organize data.
  2. pass arguments to objects of classes
  3. add features to existing classes without rewriting them
  4. improve data-hiding and encapsulation
Question 21 Multiple Choice (Single Answer)

Which of the following statements is true in Java?

  1. An object can be a class
  2. A class can be an object
  3. A class must have at least one member function.
  4. If a constructor is not specified, a default constr. is used