Exam Questions And Answers Rated A+.
Constructor - Answer In OOP a special type of method which has the same name as the class and is
used to create objects. This creation process is known as instantiation.
Instantiate - Answer The creation of an instance or particular realisation of an abstraction or template
such as a class. The product of this is an object of the class type. In OOP this is done by using a particular
method called a constructor.
Object - Answer When a class is instantiated the product is one of these. In OOP it is normally what is
returned from the constructor.
Class - Answer An extensible program-code-template for creating objects, providing initial values for
state (member variables) and implementations of behavior (member functions or methods).
Method - Answer A procedure associated with an object class. These procedures should be logical in
terms of scope and function and written to encourage re-use.
Variable - Answer A storage location paired with an associated symbolic name (an identifier), which
contains some known or unknown data referred to as a value. In many computer languages the data
type is defined and fixed.
Static - Answer A Java keyword. It can be applied to a variable, a method or an inner class. The
variables, methods or classes defined by this keyword have a single instance for the whole class and all
it's associated objects. It can be accessed when no Object has been instantiated.
Final - Answer A Java keyword. It can be applied to a variable, a method or class and indicates that it
cannot be changed , derived from over ridden or extended.
Member - Answer Belonging to an object, normally applied to variables that have an object wide
scope.
, Public - Answer An access modifier. A class, method, constructor or interface that is declared like this
can be accessed from any other class.
All methods, and variables declared like this are inherited by subclasses.
Private - Answer An access modifier. Variables, methods and constructors that are declared like this can
only be accessed from within the class.
It is the most restrictive access level. Classes cannot be declared like this.
It is the main way that an object encapsulates itself and hides data from outside the class.
Protected - Answer An access modifier. Variables, methods and constructors that are declared like this
can only be accessed by subclasses in other packages or from other classes within the same package.
Cast - Answer A reference to one object or data type can be changed to a reference to another object
or data type by this process. The objects in the class need to be related by inheritance or in the case of
primitives have a defined way of changing available.
Subroutine - Answer Another word for method.
Inheritance - Answer In this coding construct a class that is derived from another class is called a
subclass (also a derived class, extended class, or child class). The class from which the subclass is derived
is called a superclass (also a base class or a parent class).
Subclasses gain access to the public and protected members and methods of the superclass directly but
not the private members and methods. Hence the Objects of the subclass become hybrids of the super
and sub classes.
Polymorphism - Answer In simple terms it is the ability to define a method of the same name that
operates differently depending on the class in which it is defined not the data type of the object from
which it is referenced.
Encapsulation - Answer This is used to refer to one of two related but distinct notions, and sometimes
to the combination thereof:
A language mechanism for restricting access to some of the object's components.