JAVA/JAVA TESTING/C++ EXAM
2025/2026 QUESTIONS AND ANSWERS
100% PASS
What is JAVA - ANS A high-level programming language developed by Sun Microsystems. Java
was originally called OAK, and was designed for handheld devices and set-top boxes. Oak was
unsuccessful so in 1995 Sun changed the name to Java and modified the language to take
advantage of the burgeoning World Wide Web.
What are the basic concepts of object oriented programming? - ANS 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. The programming challenge was seen as how to write the logic,
not how to define the data.
Object-oriented programming takes the view that what we really care about are the objects we
want to manipulate rather than the logic required to manipulate them.
What is encapsulation? - ANS The wrapping up of data and functions into a single unit (called
class) is known as encapsulation.
1 @COPYRIGHT 2025/2026 ALLRIGHTS RESERVED.
,Encapsulation containing and hiding information about an object, such as internal data
structures and code.
Define inheritance? - ANS Inheritance is the process by which objects of one class acquire
properties of objects of another class.
It allows the extension and reuse of existing code without having to rewrite the code from
scratch.
Define polymorphism? - ANS Polymorphism simply means "many forms". In java
polymorphism is acheived through method overloading and overriding.
For example, say you have an Animal class and two sub classes called Lion and Cat class. All
animals make a sound, so lets say there is a make sound method in all of these classes.
When you call the make sound method from a lion object that is stored in an Animal reference,
it would call the make sound method from the Lion Class. That is how you would explain
polymorphism using overriding.
Define Constructors? - ANS A constructor is a member method with the same name as its
class. The constructor is invoked whenever an object of its associated class is created.It is called
constructor because it constructs the values of data members of the class.
What is a Class? - ANS A class is a blueprint for an object
What is an Object? - ANS An instance of a class
What is multiple inheritance? - ANS A class can inherit properties from more than one class
which is known as multiple inheritance.
2 @COPYRIGHT 2025/2026 ALLRIGHTS RESERVED.
, What are the advantages of inheritance? - ANS Code reusability
Saves time in program development.
What is the difference between an Array and a List? - ANS The main difference between an
array and a list is how they internally store the data. whereas Array is collection of
homogeneous elements. List is collection of heterogeneous elements.
What is an iterator? - ANS Iterators are like pointers. They are used to access the elements of
containers thus providing a link between algorithms and containers. Iterators are defined for
specific containers and used as arguments to algorithms.
What is this pointer? - ANS It is a pointer that points to the current object. This can be used
to access the members of the current object with the help of the arrow operator.
What are pass by reference and passby value? - ANS Pass By Reference means the passing
the address itself rather than passing the value.
Passby Value means passing a copy of the value to be passed.
What is the Java API? - ANS What is the Java API?
The Java API is a large collection of ready-made software components that provide many useful
capabilities, such as graphical user interface (GUI) widgets.
What is the Java Virtual Machine (JVM)? - ANS The Java Virtual Machine is software that can
be ported onto various hardware-based platforms.
What is variables and then types - ANS Variables is an identifier that denotes a storage
location used to store a data values.unlike constants that remain unchanged during the
3 @COPYRIGHT 2025/2026 ALLRIGHTS RESERVED.
2025/2026 QUESTIONS AND ANSWERS
100% PASS
What is JAVA - ANS A high-level programming language developed by Sun Microsystems. Java
was originally called OAK, and was designed for handheld devices and set-top boxes. Oak was
unsuccessful so in 1995 Sun changed the name to Java and modified the language to take
advantage of the burgeoning World Wide Web.
What are the basic concepts of object oriented programming? - ANS 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. The programming challenge was seen as how to write the logic,
not how to define the data.
Object-oriented programming takes the view that what we really care about are the objects we
want to manipulate rather than the logic required to manipulate them.
What is encapsulation? - ANS The wrapping up of data and functions into a single unit (called
class) is known as encapsulation.
1 @COPYRIGHT 2025/2026 ALLRIGHTS RESERVED.
,Encapsulation containing and hiding information about an object, such as internal data
structures and code.
Define inheritance? - ANS Inheritance is the process by which objects of one class acquire
properties of objects of another class.
It allows the extension and reuse of existing code without having to rewrite the code from
scratch.
Define polymorphism? - ANS Polymorphism simply means "many forms". In java
polymorphism is acheived through method overloading and overriding.
For example, say you have an Animal class and two sub classes called Lion and Cat class. All
animals make a sound, so lets say there is a make sound method in all of these classes.
When you call the make sound method from a lion object that is stored in an Animal reference,
it would call the make sound method from the Lion Class. That is how you would explain
polymorphism using overriding.
Define Constructors? - ANS A constructor is a member method with the same name as its
class. The constructor is invoked whenever an object of its associated class is created.It is called
constructor because it constructs the values of data members of the class.
What is a Class? - ANS A class is a blueprint for an object
What is an Object? - ANS An instance of a class
What is multiple inheritance? - ANS A class can inherit properties from more than one class
which is known as multiple inheritance.
2 @COPYRIGHT 2025/2026 ALLRIGHTS RESERVED.
, What are the advantages of inheritance? - ANS Code reusability
Saves time in program development.
What is the difference between an Array and a List? - ANS The main difference between an
array and a list is how they internally store the data. whereas Array is collection of
homogeneous elements. List is collection of heterogeneous elements.
What is an iterator? - ANS Iterators are like pointers. They are used to access the elements of
containers thus providing a link between algorithms and containers. Iterators are defined for
specific containers and used as arguments to algorithms.
What is this pointer? - ANS It is a pointer that points to the current object. This can be used
to access the members of the current object with the help of the arrow operator.
What are pass by reference and passby value? - ANS Pass By Reference means the passing
the address itself rather than passing the value.
Passby Value means passing a copy of the value to be passed.
What is the Java API? - ANS What is the Java API?
The Java API is a large collection of ready-made software components that provide many useful
capabilities, such as graphical user interface (GUI) widgets.
What is the Java Virtual Machine (JVM)? - ANS The Java Virtual Machine is software that can
be ported onto various hardware-based platforms.
What is variables and then types - ANS Variables is an identifier that denotes a storage
location used to store a data values.unlike constants that remain unchanged during the
3 @COPYRIGHT 2025/2026 ALLRIGHTS RESERVED.