OOP Flashcards
A ____, in the context of Java, are templates that are used to create objects, and to define object data types and methods. Core properties include the data types and methods that may be used by the object
class
A ____ can also be defined as a blueprint from which you can create an individual object.
class
Any entity that has state and behavior is known as an _____
object
ex. a chair, pen, table, keyboard, bike, etc. It can be physical or logical.
An Object can be defined as an instance of a class.
True or False
True
An _____ contains an address and takes up some space in memory.
Object
OOPs makes development and maintenance easier whereas in a procedure-oriented programming language it is not easy to manage if code grows as project size increases.
True or False
True
In OOPs data can be accessed from anywhere, whereas in a procedure-oriented programming language a global data can be hidden.
True or False
FALSE
OOPs provides data hiding whereas in a procedure-oriented programming language a global data can be accessed from anywhere.
A _____ is a blueprint from which individual _____ are created.
A class is a blueprint from which individual objects are created.
A _________ is called when a instance of the object is created.
constructor
When a constructor is created, _____ is allocated for the object.
memory
When an object is created, compiler makes sure that constructors for all of its subobjects (its member and inherited objects) are called.
True or False
True
A Constructor name does not have to be same same as its class name
True or False
False
Constructor name must be the same as its class name
A Constructor must have no explicit return type
True or False
True
A Java constructor can be abstract, static, final, and synchronized
False
A Java constructor cannot be abstract, static, final, and synchronized
What are the two types of constructors?
- Default Constructor
- Parameterized Constructor