SlideShare a Scribd company logo
MCQs BANK
Page: 1
Object Oriented
Programming
Topic: Introduction
Instructions:
This MCQs Bank contains question
and solution on adjacent(even-odd)
pages. First try to solve the MCQ by
yourself, then look for the solution.
Best viewed in “single page view”
in PDF viewer.
MCQs BANK No.: 1
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 1
The inclusion of property & method
within a class/object in which it
needs to function properly is called
________. Fill in the blank.
a) Encapsulation
b) Inheritance
c) Message Passing
d) Data Hiding
Page: 2
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 1 (Solution)
Ans: a) Encapsulation
Explanation:
Encapsulation is the process by
which the property & method is
included in a class/object.
Encapsulation in Java is a
mechanism of wrapping the data
(variables) and code acting on the
data (methods) together as a
single unit. In encapsulation, the
variables of a class will be hidden
from other classes, and can be
accessed only through the
methods of their current class.
Page: 3
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 2
_______________ allows child
classes to acquire the
characteristics of existing parent
class. Fill in the blank.
a) Inheritance
b) Encapsulation
c) Data Hiding
d) Message Passing
Page: 4
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 2 (Solution)
Ans: a) Inheritance
Explanation: Inheritance allows
child classes to acquire the
characteristics of existing parent
class.
Inheritance in Java is a mechanism
in which one object acquires all the
properties and behaviors of a
parent object. The idea behind
inheritance in Java is that you can
create new classes that are built
upon existing classes. When you
inherit from an existing class, you
can reuse methods and fields of
the parent class.
Page: 5
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 3
In ___________ a class can inherit
from several other classes. Fill in
the blank.
a) Single inheritance
b) Multi-level inheritance
c) Multiple inheritance
d) None of these
Page: 6
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 3 (Solution)
Ans: c) Multiple inheritance
Explanation:
Multiple inheritance is the type of
inheritance where a class inherits
properties from several other
classes.
Multiple inheritance is a feature of
some object-oriented programming
languages(such as Java) in which
an object or class can inherit
characteristics and features from
more than one parent object or
parent class.
Page: 7
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 4
An abstract class, which declared
with the “abstract” keyword, cannot
be instantiated. True or False?
a) True
b) False
Page: 8
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 4 (Solution)
Ans: a) True
Explanation:
An abstract class, which declared
with the “abstract” keyword, cannot
be instantiated. This is because in
abstract class the methods are
declared only without defining
them.
Abstract classes cannot be
instantiated, but they can be sub
classed.
Page: 9
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 5
_______________ means the
ability to request that the same
methods be performed by a wide
range of different types of things.
Fill in the blank.
a) Polymorphism
b) Data Hiding
c) Encapsulation
d) Inheritance
Page: 10
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 5 (Solution)
Ans: a) Polymorphism
Explanation: Polymorphism in Java
is a concept by which we can
perform an action in different ways,
by method overloading and method
overriding.
Polymorphism means multiple forms,
where a same method name can be
used to perform different functions,
by varying the arguments in type and
number.
Polymorphism uses a same method
to perform different tasks. This
allows us to perform a single action
in different ways.
Page: 11
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 6
A ___________ can inherit all its
___________ attributes &
methods besides having its own
unique attributes & methods. Fill in
the blanks.
a) Subclass, Superclass
b) Superclass, Subclass
c) Destructor, Constructor
d) Constructor, Destructor
Page: 12
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 6 (Solution)
Ans: a) Subclass, Superclass
Explanation:
Superclass is the Base class or the
Parent Class.
Subclass is the Derived class or
the Child Class.
Subclass inherits all the properties
of Superclass, along with its own
data members and methods..
Page: 13
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 7
________________ is an abstract
machine. It is a specification that
provides runtime environment in
which java bytecode can be
executed.
a) JDK (Java Development Kit)
b) JVM (Java Virtual Machine)
c) JRE (Java Runtime Environment)
d) None of these
Page: 14
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 7 (Solution)
Ans: b) JVM (Java Virtual Machine)
Explanation:
Java Virtual Machine is an abstract
machine. It is a specification that
provides runtime environment in
which java bytecode can be
executed. This JVM gives platform
independence of JAVA.
Java Virtual Machine (JVM) is a
engine that provides runtime
environment to drive the Java Code
or applications. It converts Java
bytecode into machines
language. JVM is a part of Java
Runtime Environment (JRE).
Page: 15
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 8
The _____________ is collection of
programming tools. Fill in the blank.
a) JVM (Java Virtual Machine)
b) JDK (Java Development Kit)
c) JRE (Java Runtime Environment)
d) None of these
Page: 16
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 8 (Solution)
Ans: b) JDK (Java Development Kit)
Explanation:
The Java Development Kit or JDK is
collection of programming tools.
The Java Development Kit (JDK) is a
software development
environment used for developing
Java applications and applets. It
includes the Java Runtime
Environment (JRE), an
interpreter/loader (java), a compiler
(javac), an archiver (jar), a
documentation generator (javadoc)
and other tools needed in Java
development.
Page: 17
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 9
____________ is the set of
optimized instructions generated
during compilation phase and it is
more powerful than ordinary
source code. Fill in the blank.
a) Bit code
b) Byte code
c) Machine code
d) None of these
Page: 18
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 9 (Solution)
Ans: b) Byte code
Explanation: Java Byte code is the
set of optimized instructions
generated during compilation phase
and it is more powerful than ordinary
source code. Byte code is an
intermediate code between the
source code & machine code. It is a
low-level code that is the result of the
compilation of a source code which
is written in a high-level language. It
is processed by a virtual machine
like Java Virtual Machine (JVM).
Byte code is referred to as a
Portable code.
Page: 19
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 10
Out of the following which one is not
correctly matched ?
a) JAVA - Object Oriented Language
b) FORTRAN - Object Oriented
Language
c) C++ - Object Oriented Language
d) BASIC - Procedural Language
Page: 20
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 10 (Solution)
Ans: b) FORTRAN - Object Oriented
Language
Explanation:
FORTRAN (derived from Formula
Translation) is a Procedural
Programming Language that uses
traditional way of calling functions
and returning values. Originally
developed by IBM in the 1950s for
scientific and engineering
applications.
Page: 21
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 11
Consider the following 2
statements(S1 and S2).
(S1) C++ uses compiler only.
(S2) Java uses compiler and
interpreter both.
Which of the following is correct.
a) S1 is TRUE and S2 is FALSE
b) S1 is FALSE and S2 is TRUE
c) Both S1 and S2 are TRUE
d) Both S1 and S2 are FALSE
Page: 22
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 11 (Solution)
Ans: c) Both S1 and S2 are TRUE
Explanation:
C++ uses compiler only. There is no
use of interpreter in C++ executable
code.
Java uses compiler and interpreter
both. Java Compiler converts the
Java Source Code into intermediate
code (known as the Byte code). This
Byte Code is interpreted by JVM.
Page: 23
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 12
Object Oriented Programming
Language follows _____________
approach of Program Execution.
Fill in the blank.
a) Top Down
b) Bottom Up
c) Random
d) Dynamic
Page: 24
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 12 (Solution)
Ans: b) Bottom Up
Explanation:
The top-down approach focuses on
breaking down a big program into
smaller procedures(functions) or
modules. Procedural Programming
Languages use top-down approach.
Object-oriented language such as
C++ or java uses a bottom-up
approach where each object is
identified first. After that, make
decisions about reusable low-level
utilities then decide how there will be
put together to create high-level
construct.
Page: 25
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 13
Consider the following 2
statements (S1 and S2).
(S1)Java is platform independent.
(S2)C++ is platform dependent.
Which of the following is correct.
a) S1 is TRUE and S2 is FALSE
b) S1 is FALSE and S2 is TRUE
c) Both S1 and S2 are TRUE
d) Both S1 and S2 are FALSE
Page: 26
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 13 (Solution)
Ans: c) Both S1 and S2 are TRUE
Explanation:
Java Compiler converts the Java
Source Code into intermediate code
(known as the Byte code). This Byte
Code is interpreted by JVM. The
Byte Code can be executed on any
platform where JVM is present.
C++ uses compiler to generate
Machine dependent executable
code.
Page: 27
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 14
Which of the following is not a Java
features?
a) Dynamic
b) Architecture Neutral
c) Use of pointers
d) Object-oriented
Page: 28
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 14 (Solution)
Ans: c) Use of pointers.
Explanation:
Java does not have any concept of
pointers.
Java has references. It's a fine point,
but a pointer has extra operations
that you may (or may not) typically
use; a reference lacks these
operations because the operations
may be unsafe.
Page: 29
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 15
Which of the following tool is used
to generate API documentation in
HTML format from doc comments
in source code?
a) javap tool
b) javaw command
c) Javadoc tool
d) javah command
Page: 30
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 15 (Solution)
Ans: c) Javadoc tool
Explanation: Javadoc tool of JDK is
used to generate API(Application
Program Interface) documentation in
HTML format from doc comments in
source code.
Javadoc is a documentation
generator created by Sun
Microsystems for the Java language
for generating API documentation in
HTML format from Java source
code. The HTML format is used for
adding the convenience of being
able to hyperlink related documents
together.
Page: 31
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 16
In which memory a String is stored,
when we create a string using new
operator?
a) Stack
b) String memory
c) Heap memory
d) Random storage space
Page: 32
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 16 (Solution)
Ans: c) Heap memory
Explanation:
Heap Memory is the free memory of
RAM which is used to store any
variables, objects declared during
program execution.
Heap memory is the run time data
area from which the memory for all
java class instances and arrays is
allocated. The heap is created when
the Java Virtual Machine starts up
and may increase or decrease in
size while the application runs.
Page: 33
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 17
Which keyword is used for
accessing the features of a
package?
a) package
b) import
c) extends
d) export
Page: 34
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 17 (Solution)
Ans: b) import
Explanation:
import keyword is used to import or
add packages in Java Program.
It declares a Java class to use in the
code below the import statement.
Once a Java class is declared, then
the class name can be used in the
code without specifying the package
the class belongs to.
Example:
import java.lang.*;
Page: 35
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 18
Which of the following is NOT an
Object Oriented Programming
Language?
a) C
b) JAVA
c) C#.NET
d) VB.NET
Page: 36
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 18 (Solution)
Ans: a) C
Explanation:
C is NOT Object Oriented
Programming Language, it is
Procedural Programming Language.
All the others are Object Oriented
Programming Language.
Page: 37
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 19
Which of the following statements
is NOT TRUE about Java.
a) Everything is an object in Java.
b) There is no "goto" statement in
Java.
c) Java support destructors.
d) Java does not support
conditional compile (#ifdef / #ifndef
type).
Page: 38
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 19 (Solution)
Ans: c) Java support destructors.
Explanation: In Java, when we create an
object of the class it occupies some space
in the memory (heap). If we do not delete
these objects, it remains in the memory
and occupies unnecessary space that is
not upright from the aspect of
programming.
There are no destructors in Java, Java
provides automatic garbage collection and
hence destructors are not required in Java.
The garbage collector is a program (thread)
that runs on the JVM. It automatically
deletes the unused objects (objects that
are no longer used) and free-up the
memory. The programmer has no need to
manage memory, manually.
Page: 39
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 20
"To represent the essential feature
without representing the back
ground details" is known as
_________. Fill in the blank.
a) Inheritance
b) Abstraction
c) Encapsulation
d) Polymorphism
Page: 40
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 20 (Solution)
Ans: b) Abstraction
Explanation:
Abstraction is "To represent the
essential feature without
representing the back ground
details."
Abstraction lets us focus on what the
object does instead of how it does it.
Page: 41

More Related Content

What's hot (20)

PPTX
Introduction to Node js
Akshay Mathur
 
PPT
C# Exceptions Handling
sharqiyem
 
PDF
Multiple Choice Questions on JAVA (object oriented programming) bank 6 -- inh...
Kuntal Bhowmick
 
PPT
Java basic tutorial by sanjeevini india
Sanjeev Tripathi
 
PPTX
Exploring the power of Gradle in android studio - Basics & Beyond
Kaushal Dhruw
 
PPTX
Exceptions in Java
Vadym Lotar
 
PDF
Asp.net caching
Mindfire Solutions
 
PDF
Core Java Tutorial
eMexo Technologies
 
PPTX
Bdd – with cucumber and gherkin
Arati Joshi
 
PDF
Multiple Choice Questions on JAVA (object oriented programming) bank 7 -- abs...
Kuntal Bhowmick
 
PPTX
Introduction to java
Java Lover
 
PPTX
9 subprograms
Munawar Ahmed
 
PDF
Java notes | All Basics |
ShubhamAthawane
 
PPTX
Session tracking In Java
honeyvachharajani
 
PDF
Spring Data JDBC: Beyond the Obvious
VMware Tanzu
 
PPTX
JAVA ENVIRONMENT
josemachoco
 
PDF
Introduction to Java Programming Language
jaimefrozr
 
PPS
Jdbc architecture and driver types ppt
kamal kotecha
 
PPTX
Introduction to EJB
Return on Intelligence
 
Introduction to Node js
Akshay Mathur
 
C# Exceptions Handling
sharqiyem
 
Multiple Choice Questions on JAVA (object oriented programming) bank 6 -- inh...
Kuntal Bhowmick
 
Java basic tutorial by sanjeevini india
Sanjeev Tripathi
 
Exploring the power of Gradle in android studio - Basics & Beyond
Kaushal Dhruw
 
Exceptions in Java
Vadym Lotar
 
Asp.net caching
Mindfire Solutions
 
Core Java Tutorial
eMexo Technologies
 
Bdd – with cucumber and gherkin
Arati Joshi
 
Multiple Choice Questions on JAVA (object oriented programming) bank 7 -- abs...
Kuntal Bhowmick
 
Introduction to java
Java Lover
 
9 subprograms
Munawar Ahmed
 
Java notes | All Basics |
ShubhamAthawane
 
Session tracking In Java
honeyvachharajani
 
Spring Data JDBC: Beyond the Obvious
VMware Tanzu
 
JAVA ENVIRONMENT
josemachoco
 
Introduction to Java Programming Language
jaimefrozr
 
Jdbc architecture and driver types ppt
kamal kotecha
 
Introduction to EJB
Return on Intelligence
 

Similar to Multiple Choice Questions on JAVA (object oriented programming) bank 1 -- introduction (20)

PDF
Introduction to Java Object Oriented Programming
makmadz
 
PDF
OOM MCQ 2018
lochan100
 
PDF
Multiple Choice Questions on JAVA (object oriented programming) bank 5 -- mem...
Kuntal Bhowmick
 
PPTX
chapter 5 concepts of object oriented programming
WondimuBantihun1
 
PPT
Unit 1- Basic concept of object-oriented-programming.ppt
hannahroseline2
 
PDF
FINAL PAPER FP301 OBJECT ORIENTED PROGRAMMING
Amira Dolce Farhana
 
PDF
Oop question-bank
NITIN BHOPALE
 
PPT
Java OOP s concepts and buzzwords
Raja Sekhar
 
PPT
Share Unit 1- Basic concept of object-oriented-programming.ppt
hannahrroselin95
 
DOCX
OOP Lab-manual btech in cse kerala technological university
seenamt1234
 
PDF
computer exercise chapter 1 for Ninth Standard
AmitGhosh934008
 
PPTX
Std 12 Computer Chapter 6 object oriented concept important mcqs
Nuzhat Memon
 
PDF
Cs8392 oops 5 units notes
Narayanan sockalinganathan
 
PDF
FP 301 OOP FINAL PAPER
Syahriha Ruslan
 
PDF
Qb it1301
ArthyR3
 
PDF
Java Programming.pdf
RavinderKSingla
 
PDF
ITI COPA Java MCQ important Questions and Answers
SONU HEETSON
 
TXT
CORE JAVA
Shohan Ahmed
 
PPTX
Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...
Ayes Chinmay
 
PPTX
Oop.pptx
KalGetachew2
 
Introduction to Java Object Oriented Programming
makmadz
 
OOM MCQ 2018
lochan100
 
Multiple Choice Questions on JAVA (object oriented programming) bank 5 -- mem...
Kuntal Bhowmick
 
chapter 5 concepts of object oriented programming
WondimuBantihun1
 
Unit 1- Basic concept of object-oriented-programming.ppt
hannahroseline2
 
FINAL PAPER FP301 OBJECT ORIENTED PROGRAMMING
Amira Dolce Farhana
 
Oop question-bank
NITIN BHOPALE
 
Java OOP s concepts and buzzwords
Raja Sekhar
 
Share Unit 1- Basic concept of object-oriented-programming.ppt
hannahrroselin95
 
OOP Lab-manual btech in cse kerala technological university
seenamt1234
 
computer exercise chapter 1 for Ninth Standard
AmitGhosh934008
 
Std 12 Computer Chapter 6 object oriented concept important mcqs
Nuzhat Memon
 
Cs8392 oops 5 units notes
Narayanan sockalinganathan
 
FP 301 OOP FINAL PAPER
Syahriha Ruslan
 
Qb it1301
ArthyR3
 
Java Programming.pdf
RavinderKSingla
 
ITI COPA Java MCQ important Questions and Answers
SONU HEETSON
 
CORE JAVA
Shohan Ahmed
 
Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...
Ayes Chinmay
 
Oop.pptx
KalGetachew2
 
Ad

More from Kuntal Bhowmick (20)

PDF
Multiple Choice Questions on JAVA (object oriented programming) bank 4 -- loops
Kuntal Bhowmick
 
PDF
Hashing notes data structures (HASHING AND HASH FUNCTIONS)
Kuntal Bhowmick
 
PPT
1. introduction to E-commerce
Kuntal Bhowmick
 
DOCX
Computer graphics question for exam solved
Kuntal Bhowmick
 
PDF
DBMS and Rdbms fundamental concepts
Kuntal Bhowmick
 
PDF
Java questions for interview
Kuntal Bhowmick
 
PDF
Java Interview Questions
Kuntal Bhowmick
 
PDF
Operating system Interview Questions
Kuntal Bhowmick
 
PDF
Computer Network Interview Questions
Kuntal Bhowmick
 
PDF
C interview questions
Kuntal Bhowmick
 
PDF
C question
Kuntal Bhowmick
 
PDF
Distributed operating systems cs704 a class test
Kuntal Bhowmick
 
DOCX
Cs291 assignment solution
Kuntal Bhowmick
 
DOCX
CS291(C Programming) assignment
Kuntal Bhowmick
 
PDF
C programming guide new
Kuntal Bhowmick
 
PDF
C lecture notes new
Kuntal Bhowmick
 
PDF
Shell script assignment 3
Kuntal Bhowmick
 
DOCX
Basic shell programs assignment 1
Kuntal Bhowmick
 
PDF
Basic shell programs assignment 1_solution_manual
Kuntal Bhowmick
 
DOCX
Shell programming assignment 2
Kuntal Bhowmick
 
Multiple Choice Questions on JAVA (object oriented programming) bank 4 -- loops
Kuntal Bhowmick
 
Hashing notes data structures (HASHING AND HASH FUNCTIONS)
Kuntal Bhowmick
 
1. introduction to E-commerce
Kuntal Bhowmick
 
Computer graphics question for exam solved
Kuntal Bhowmick
 
DBMS and Rdbms fundamental concepts
Kuntal Bhowmick
 
Java questions for interview
Kuntal Bhowmick
 
Java Interview Questions
Kuntal Bhowmick
 
Operating system Interview Questions
Kuntal Bhowmick
 
Computer Network Interview Questions
Kuntal Bhowmick
 
C interview questions
Kuntal Bhowmick
 
C question
Kuntal Bhowmick
 
Distributed operating systems cs704 a class test
Kuntal Bhowmick
 
Cs291 assignment solution
Kuntal Bhowmick
 
CS291(C Programming) assignment
Kuntal Bhowmick
 
C programming guide new
Kuntal Bhowmick
 
C lecture notes new
Kuntal Bhowmick
 
Shell script assignment 3
Kuntal Bhowmick
 
Basic shell programs assignment 1
Kuntal Bhowmick
 
Basic shell programs assignment 1_solution_manual
Kuntal Bhowmick
 
Shell programming assignment 2
Kuntal Bhowmick
 
Ad

Recently uploaded (20)

DOC
MRRS Strength and Durability of Concrete
CivilMythili
 
PPTX
Green Building & Energy Conservation ppt
Sagar Sarangi
 
PDF
MAD Unit - 2 Activity and Fragment Management in Android (Diploma IT)
JappanMavani
 
PPTX
GitOps_Without_K8s_Training_detailed git repository
DanialHabibi2
 
PDF
Design Thinking basics for Engineers.pdf
CMR University
 
PPTX
artificial intelligence applications in Geomatics
NawrasShatnawi1
 
PDF
Reasons for the succes of MENARD PRESSUREMETER.pdf
majdiamz
 
PPTX
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
PPTX
Introduction to Neural Networks and Perceptron Learning Algorithm.pptx
Kayalvizhi A
 
DOCX
8th International Conference on Electrical Engineering (ELEN 2025)
elelijjournal653
 
PPTX
MPMC_Module-2 xxxxxxxxxxxxxxxxxxxxx.pptx
ShivanshVaidya5
 
PPTX
Element 11. ELECTRICITY safety and hazards
merrandomohandas
 
PPTX
Arduino Based Gas Leakage Detector Project
CircuitDigest
 
PDF
Pressure Measurement training for engineers and Technicians
AIESOLUTIONS
 
PPTX
GitOps_Repo_Structure for begeinner(Scaffolindg)
DanialHabibi2
 
PDF
Ethics and Trustworthy AI in Healthcare – Governing Sensitive Data, Profiling...
AlqualsaDIResearchGr
 
PDF
GTU Civil Engineering All Semester Syllabus.pdf
Vimal Bhojani
 
PDF
Water Design_Manual_2005. KENYA FOR WASTER SUPPLY AND SEWERAGE
DancanNgutuku
 
PPTX
Thermal runway and thermal stability.pptx
godow93766
 
PDF
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 
MRRS Strength and Durability of Concrete
CivilMythili
 
Green Building & Energy Conservation ppt
Sagar Sarangi
 
MAD Unit - 2 Activity and Fragment Management in Android (Diploma IT)
JappanMavani
 
GitOps_Without_K8s_Training_detailed git repository
DanialHabibi2
 
Design Thinking basics for Engineers.pdf
CMR University
 
artificial intelligence applications in Geomatics
NawrasShatnawi1
 
Reasons for the succes of MENARD PRESSUREMETER.pdf
majdiamz
 
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
Introduction to Neural Networks and Perceptron Learning Algorithm.pptx
Kayalvizhi A
 
8th International Conference on Electrical Engineering (ELEN 2025)
elelijjournal653
 
MPMC_Module-2 xxxxxxxxxxxxxxxxxxxxx.pptx
ShivanshVaidya5
 
Element 11. ELECTRICITY safety and hazards
merrandomohandas
 
Arduino Based Gas Leakage Detector Project
CircuitDigest
 
Pressure Measurement training for engineers and Technicians
AIESOLUTIONS
 
GitOps_Repo_Structure for begeinner(Scaffolindg)
DanialHabibi2
 
Ethics and Trustworthy AI in Healthcare – Governing Sensitive Data, Profiling...
AlqualsaDIResearchGr
 
GTU Civil Engineering All Semester Syllabus.pdf
Vimal Bhojani
 
Water Design_Manual_2005. KENYA FOR WASTER SUPPLY AND SEWERAGE
DancanNgutuku
 
Thermal runway and thermal stability.pptx
godow93766
 
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 

Multiple Choice Questions on JAVA (object oriented programming) bank 1 -- introduction

  • 1. MCQs BANK Page: 1 Object Oriented Programming Topic: Introduction Instructions: This MCQs Bank contains question and solution on adjacent(even-odd) pages. First try to solve the MCQ by yourself, then look for the solution. Best viewed in “single page view” in PDF viewer. MCQs BANK No.: 1
  • 2. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 1 The inclusion of property & method within a class/object in which it needs to function properly is called ________. Fill in the blank. a) Encapsulation b) Inheritance c) Message Passing d) Data Hiding Page: 2
  • 3. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 1 (Solution) Ans: a) Encapsulation Explanation: Encapsulation is the process by which the property & method is included in a class/object. Encapsulation in Java is a mechanism of wrapping the data (variables) and code acting on the data (methods) together as a single unit. In encapsulation, the variables of a class will be hidden from other classes, and can be accessed only through the methods of their current class. Page: 3
  • 4. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 2 _______________ allows child classes to acquire the characteristics of existing parent class. Fill in the blank. a) Inheritance b) Encapsulation c) Data Hiding d) Message Passing Page: 4
  • 5. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 2 (Solution) Ans: a) Inheritance Explanation: Inheritance allows child classes to acquire the characteristics of existing parent class. Inheritance in Java is a mechanism in which one object acquires all the properties and behaviors of a parent object. The idea behind inheritance in Java is that you can create new classes that are built upon existing classes. When you inherit from an existing class, you can reuse methods and fields of the parent class. Page: 5
  • 6. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 3 In ___________ a class can inherit from several other classes. Fill in the blank. a) Single inheritance b) Multi-level inheritance c) Multiple inheritance d) None of these Page: 6
  • 7. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 3 (Solution) Ans: c) Multiple inheritance Explanation: Multiple inheritance is the type of inheritance where a class inherits properties from several other classes. Multiple inheritance is a feature of some object-oriented programming languages(such as Java) in which an object or class can inherit characteristics and features from more than one parent object or parent class. Page: 7
  • 8. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 4 An abstract class, which declared with the “abstract” keyword, cannot be instantiated. True or False? a) True b) False Page: 8
  • 9. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 4 (Solution) Ans: a) True Explanation: An abstract class, which declared with the “abstract” keyword, cannot be instantiated. This is because in abstract class the methods are declared only without defining them. Abstract classes cannot be instantiated, but they can be sub classed. Page: 9
  • 10. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 5 _______________ means the ability to request that the same methods be performed by a wide range of different types of things. Fill in the blank. a) Polymorphism b) Data Hiding c) Encapsulation d) Inheritance Page: 10
  • 11. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 5 (Solution) Ans: a) Polymorphism Explanation: Polymorphism in Java is a concept by which we can perform an action in different ways, by method overloading and method overriding. Polymorphism means multiple forms, where a same method name can be used to perform different functions, by varying the arguments in type and number. Polymorphism uses a same method to perform different tasks. This allows us to perform a single action in different ways. Page: 11
  • 12. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 6 A ___________ can inherit all its ___________ attributes & methods besides having its own unique attributes & methods. Fill in the blanks. a) Subclass, Superclass b) Superclass, Subclass c) Destructor, Constructor d) Constructor, Destructor Page: 12
  • 13. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 6 (Solution) Ans: a) Subclass, Superclass Explanation: Superclass is the Base class or the Parent Class. Subclass is the Derived class or the Child Class. Subclass inherits all the properties of Superclass, along with its own data members and methods.. Page: 13
  • 14. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 7 ________________ is an abstract machine. It is a specification that provides runtime environment in which java bytecode can be executed. a) JDK (Java Development Kit) b) JVM (Java Virtual Machine) c) JRE (Java Runtime Environment) d) None of these Page: 14
  • 15. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 7 (Solution) Ans: b) JVM (Java Virtual Machine) Explanation: Java Virtual Machine is an abstract machine. It is a specification that provides runtime environment in which java bytecode can be executed. This JVM gives platform independence of JAVA. Java Virtual Machine (JVM) is a engine that provides runtime environment to drive the Java Code or applications. It converts Java bytecode into machines language. JVM is a part of Java Runtime Environment (JRE). Page: 15
  • 16. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 8 The _____________ is collection of programming tools. Fill in the blank. a) JVM (Java Virtual Machine) b) JDK (Java Development Kit) c) JRE (Java Runtime Environment) d) None of these Page: 16
  • 17. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 8 (Solution) Ans: b) JDK (Java Development Kit) Explanation: The Java Development Kit or JDK is collection of programming tools. The Java Development Kit (JDK) is a software development environment used for developing Java applications and applets. It includes the Java Runtime Environment (JRE), an interpreter/loader (java), a compiler (javac), an archiver (jar), a documentation generator (javadoc) and other tools needed in Java development. Page: 17
  • 18. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 9 ____________ is the set of optimized instructions generated during compilation phase and it is more powerful than ordinary source code. Fill in the blank. a) Bit code b) Byte code c) Machine code d) None of these Page: 18
  • 19. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 9 (Solution) Ans: b) Byte code Explanation: Java Byte code is the set of optimized instructions generated during compilation phase and it is more powerful than ordinary source code. Byte code is an intermediate code between the source code & machine code. It is a low-level code that is the result of the compilation of a source code which is written in a high-level language. It is processed by a virtual machine like Java Virtual Machine (JVM). Byte code is referred to as a Portable code. Page: 19
  • 20. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 10 Out of the following which one is not correctly matched ? a) JAVA - Object Oriented Language b) FORTRAN - Object Oriented Language c) C++ - Object Oriented Language d) BASIC - Procedural Language Page: 20
  • 21. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 10 (Solution) Ans: b) FORTRAN - Object Oriented Language Explanation: FORTRAN (derived from Formula Translation) is a Procedural Programming Language that uses traditional way of calling functions and returning values. Originally developed by IBM in the 1950s for scientific and engineering applications. Page: 21
  • 22. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 11 Consider the following 2 statements(S1 and S2). (S1) C++ uses compiler only. (S2) Java uses compiler and interpreter both. Which of the following is correct. a) S1 is TRUE and S2 is FALSE b) S1 is FALSE and S2 is TRUE c) Both S1 and S2 are TRUE d) Both S1 and S2 are FALSE Page: 22
  • 23. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 11 (Solution) Ans: c) Both S1 and S2 are TRUE Explanation: C++ uses compiler only. There is no use of interpreter in C++ executable code. Java uses compiler and interpreter both. Java Compiler converts the Java Source Code into intermediate code (known as the Byte code). This Byte Code is interpreted by JVM. Page: 23
  • 24. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 12 Object Oriented Programming Language follows _____________ approach of Program Execution. Fill in the blank. a) Top Down b) Bottom Up c) Random d) Dynamic Page: 24
  • 25. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 12 (Solution) Ans: b) Bottom Up Explanation: The top-down approach focuses on breaking down a big program into smaller procedures(functions) or modules. Procedural Programming Languages use top-down approach. Object-oriented language such as C++ or java uses a bottom-up approach where each object is identified first. After that, make decisions about reusable low-level utilities then decide how there will be put together to create high-level construct. Page: 25
  • 26. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 13 Consider the following 2 statements (S1 and S2). (S1)Java is platform independent. (S2)C++ is platform dependent. Which of the following is correct. a) S1 is TRUE and S2 is FALSE b) S1 is FALSE and S2 is TRUE c) Both S1 and S2 are TRUE d) Both S1 and S2 are FALSE Page: 26
  • 27. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 13 (Solution) Ans: c) Both S1 and S2 are TRUE Explanation: Java Compiler converts the Java Source Code into intermediate code (known as the Byte code). This Byte Code is interpreted by JVM. The Byte Code can be executed on any platform where JVM is present. C++ uses compiler to generate Machine dependent executable code. Page: 27
  • 28. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 14 Which of the following is not a Java features? a) Dynamic b) Architecture Neutral c) Use of pointers d) Object-oriented Page: 28
  • 29. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 14 (Solution) Ans: c) Use of pointers. Explanation: Java does not have any concept of pointers. Java has references. It's a fine point, but a pointer has extra operations that you may (or may not) typically use; a reference lacks these operations because the operations may be unsafe. Page: 29
  • 30. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 15 Which of the following tool is used to generate API documentation in HTML format from doc comments in source code? a) javap tool b) javaw command c) Javadoc tool d) javah command Page: 30
  • 31. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 15 (Solution) Ans: c) Javadoc tool Explanation: Javadoc tool of JDK is used to generate API(Application Program Interface) documentation in HTML format from doc comments in source code. Javadoc is a documentation generator created by Sun Microsystems for the Java language for generating API documentation in HTML format from Java source code. The HTML format is used for adding the convenience of being able to hyperlink related documents together. Page: 31
  • 32. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 16 In which memory a String is stored, when we create a string using new operator? a) Stack b) String memory c) Heap memory d) Random storage space Page: 32
  • 33. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 16 (Solution) Ans: c) Heap memory Explanation: Heap Memory is the free memory of RAM which is used to store any variables, objects declared during program execution. Heap memory is the run time data area from which the memory for all java class instances and arrays is allocated. The heap is created when the Java Virtual Machine starts up and may increase or decrease in size while the application runs. Page: 33
  • 34. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 17 Which keyword is used for accessing the features of a package? a) package b) import c) extends d) export Page: 34
  • 35. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 17 (Solution) Ans: b) import Explanation: import keyword is used to import or add packages in Java Program. It declares a Java class to use in the code below the import statement. Once a Java class is declared, then the class name can be used in the code without specifying the package the class belongs to. Example: import java.lang.*; Page: 35
  • 36. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 18 Which of the following is NOT an Object Oriented Programming Language? a) C b) JAVA c) C#.NET d) VB.NET Page: 36
  • 37. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 18 (Solution) Ans: a) C Explanation: C is NOT Object Oriented Programming Language, it is Procedural Programming Language. All the others are Object Oriented Programming Language. Page: 37
  • 38. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 19 Which of the following statements is NOT TRUE about Java. a) Everything is an object in Java. b) There is no "goto" statement in Java. c) Java support destructors. d) Java does not support conditional compile (#ifdef / #ifndef type). Page: 38
  • 39. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 19 (Solution) Ans: c) Java support destructors. Explanation: In Java, when we create an object of the class it occupies some space in the memory (heap). If we do not delete these objects, it remains in the memory and occupies unnecessary space that is not upright from the aspect of programming. There are no destructors in Java, Java provides automatic garbage collection and hence destructors are not required in Java. The garbage collector is a program (thread) that runs on the JVM. It automatically deletes the unused objects (objects that are no longer used) and free-up the memory. The programmer has no need to manage memory, manually. Page: 39
  • 40. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 20 "To represent the essential feature without representing the back ground details" is known as _________. Fill in the blank. a) Inheritance b) Abstraction c) Encapsulation d) Polymorphism Page: 40
  • 41. MCQs Bank on Object Oriented Programming Topic : Introduction MCQ No: 20 (Solution) Ans: b) Abstraction Explanation: Abstraction is "To represent the essential feature without representing the back ground details." Abstraction lets us focus on what the object does instead of how it does it. Page: 41