OOP TEST QUESTIONS AND
ANSWERS
What is OOP? - ANSWER Object-oriented programming (OOP) is a
programming language model organized around objects rather than "actions"
and data rather than logic. Historically, a program has been viewed as a logical
procedure that takes input data, processes it, and produces output data.
4 Basic Concepts of OOP - ANSWER Abstraction.
Encapsulation.
Inheritance.
Polymorphism.
What is a class? - ANSWER A set or category of things having some property
or attribute in common and differentiated from others by kind, type, or quality.
What is an object? - ANSWER Objects are created from Classes, in C#, is an
instance of a class that is created dynamically. Object is also a keyword that is
an alias for the predefined type System.
What is encapsulation? - ANSWER Encapsulation is the packing of data and
functions into a single component. The features of encapsulation are supported
using classes in most object-oriented programming languages, although other
alternatives also exist.
It allows selective hiding of properties and methods in an object by building an
impenetrable wall to protect the code from accidental corruption.
What is polymorphism? - ANSWER In programming languages and type
theory, polymorphism is the provision of a single interface to entities of
different types.
A polymorphic type is a type whose operations can also be applied to values of
some other type, or types.
ANSWERS
What is OOP? - ANSWER Object-oriented programming (OOP) is a
programming language model organized around objects rather than "actions"
and data rather than logic. Historically, a program has been viewed as a logical
procedure that takes input data, processes it, and produces output data.
4 Basic Concepts of OOP - ANSWER Abstraction.
Encapsulation.
Inheritance.
Polymorphism.
What is a class? - ANSWER A set or category of things having some property
or attribute in common and differentiated from others by kind, type, or quality.
What is an object? - ANSWER Objects are created from Classes, in C#, is an
instance of a class that is created dynamically. Object is also a keyword that is
an alias for the predefined type System.
What is encapsulation? - ANSWER Encapsulation is the packing of data and
functions into a single component. The features of encapsulation are supported
using classes in most object-oriented programming languages, although other
alternatives also exist.
It allows selective hiding of properties and methods in an object by building an
impenetrable wall to protect the code from accidental corruption.
What is polymorphism? - ANSWER In programming languages and type
theory, polymorphism is the provision of a single interface to entities of
different types.
A polymorphic type is a type whose operations can also be applied to values of
some other type, or types.