Java Object-Oriented Programming
About the Fundamental Concept of Object-Oriented-Programming in Java
Questions
OOP promotes a way of programming that allows programmers to think in terms of:
- Data
- Procedures
- Objects
- Orientation
What Java keyword do you use to define a class?
- define
- super
- extend
- class
A procedure in a class that describes an action that an object can perform is called
- Method
- Function
- Procedure
- Property
A member function
- is always public
- is always private
- can be public or private
- cannot be defined
Constructors are used to
- To build a user interface
- To initialize a newly created object
- To free memory
- to create a sub class
Access to an object only through its member functions, while keeping the details private is
- Mudularity
- Inheritance
- Encapsulation
- Polymorphism
Can objects of abstract classes be instantiated
- Yes
- No
- Maybe
- If you force enough
Pick the term that relates to polymorphism
- Dynamic Binding
- Dynamic Allocation
- Static Typing
- Static Allocation
Two or more methods with same name in the same class with different arguments is called as
- Method Overriding
- Method Overloading
- Method Overbooking
- Method Overestimating
An object that has more than one form is referred to as
- Inheritance
- Interface
- Polymorphism
- Abstraction
A blueprint of an object is referred to as a ______.
- Method
- Function
- Property
- Class
Keyword which is used to access the method or member variables from the parent class is:
- import
- using
- is_a
- super
When subclass declares a method that has the same arguments as declared by its superclass
- Method Overloading
- Operator Overloading
- Method Overrriding
- Operator Overriding
Main method can be overriden
- Yes
- No
- Sometimes
- with brute force
Constructors never have an explicit return type
- True
- False
Which of the following is not a part of OOP?
- Type Checking
- Polymorphism
- Multithreading
- Encapsulation
What are the two common characteristics shared by all objects?
- Methods and interfaces
- State and behavior
- Methods and messages
What really happens when a message is sent to an object?
- A method is called on that object
- A member variable is set for that object
- A text string is assigned to the object.
When a class is based on another class, it inherits:
- The data and methods for the class
- The methods and messages for the class
- Only the data for the class
Inheritance is a way to
- organize data.
- pass arguments to objects of classes
- add features to existing classes without rewriting them
- improve data-hiding and encapsulation
Which of the following statements is true in Java?
- An object can be a class
- A class can be an object
- A class must have at least one member function.
- If a constructor is not specified, a default constr. is used