0

Java Object-Oriented Programming

Description: About the Fundamental Concept of Object-Oriented-Programming in Java
Number of Questions: 21
Created by:
Tags: java oops programming
Attempted 0/21 Correct 0 Score 0

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

  1. Data

  2. Procedures

  3. Objects

  4. Orientation


Correct Option: C

What Java keyword do you use to define a class?

  1. define

  2. super

  3. extend

  4. class


Correct Option: D

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

  1. Method

  2. Function

  3. Procedure

  4. Property


Correct Option: A

A member function

  1. is always public

  2. is always private

  3. can be public or private

  4. cannot be defined


Correct Option: C

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


Correct Option: B

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

  1. Mudularity

  2. Inheritance

  3. Encapsulation

  4. Polymorphism


Correct Option: C

Can objects of abstract classes be instantiated

  1. Yes

  2. No

  3. Maybe

  4. If you force enough


Correct Option: B

Pick the term that relates to polymorphism

  1. Dynamic Binding

  2. Dynamic Allocation

  3. Static Typing

  4. Static Allocation


Correct Option: A

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


Correct Option: B

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

  1. Inheritance

  2. Interface

  3. Polymorphism

  4. Abstraction


Correct Option: C

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

  1. Method

  2. Function

  3. Property

  4. Class


Correct Option: D

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


Correct Option: D

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


Correct Option: C

Main method can be overriden

  1. Yes

  2. No

  3. Sometimes

  4. with brute force


Correct Option: B

Constructors never have an explicit return type

  1. True

  2. False


Correct Option: A

Which of the following is not a part of OOP?

  1. Type Checking

  2. Polymorphism

  3. Multithreading

  4. Encapsulation


Correct Option: C

What are the two common characteristics shared by all objects?

  1. Methods and interfaces

  2. State and behavior

  3. Methods and messages


Correct Option: B

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.


Correct Option: A

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


Correct Option: A

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


Correct Option: C

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


Correct Option: D
- Hide questions