SlideShare a Scribd company logo
1 of 41
Download to read offline
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

Unit 1( modelling concepts & class modeling)
Unit  1( modelling concepts & class modeling)Unit  1( modelling concepts & class modeling)
Unit 1( modelling concepts & class modeling)Manoj Reddy
 
Evolution and Advancement in Chipsets
Evolution and Advancement in ChipsetsEvolution and Advancement in Chipsets
Evolution and Advancement in ChipsetsDr. Shivananda Koteshwar
 
Multiple Choice Questions on JAVA (object oriented programming) bank 8 -- int...
Multiple Choice Questions on JAVA (object oriented programming) bank 8 -- int...Multiple Choice Questions on JAVA (object oriented programming) bank 8 -- int...
Multiple Choice Questions on JAVA (object oriented programming) bank 8 -- int...Kuntal Bhowmick
 
Being Functional on Reactive Streams with Spring Reactor
Being Functional on Reactive Streams with Spring ReactorBeing Functional on Reactive Streams with Spring Reactor
Being Functional on Reactive Streams with Spring ReactorMax Huang
 
Proguard: detecting malicious accounts in social-network-based online promotions
Proguard: detecting malicious accounts in social-network-based online promotionsProguard: detecting malicious accounts in social-network-based online promotions
Proguard: detecting malicious accounts in social-network-based online promotionsVaishali Misra
 
Rapid application development model
Rapid application development modelRapid application development model
Rapid application development modelVaibhav Dash
 
Making of an Application Specific Integrated Circuit
Making of an Application Specific Integrated CircuitMaking of an Application Specific Integrated Circuit
Making of an Application Specific Integrated CircuitSWINDONSilicon
 
Fundamentals of JAVA
Fundamentals of JAVAFundamentals of JAVA
Fundamentals of JAVAKUNAL GADHIA
 
Testing Spring Applications
Testing Spring ApplicationsTesting Spring Applications
Testing Spring ApplicationsMuhammad Abdullah
 
Design Patterns - General Introduction
Design Patterns - General IntroductionDesign Patterns - General Introduction
Design Patterns - General IntroductionAsma CHERIF
 
Threads presentation
Threads presentationThreads presentation
Threads presentationLawrence Galvez
 
GPGPU Computation
GPGPU ComputationGPGPU Computation
GPGPU Computationjtsagata
 
Understanding Reactive Programming
Understanding Reactive ProgrammingUnderstanding Reactive Programming
Understanding Reactive ProgrammingAndres Almiray
 
Reasoning practice workbook
Reasoning  practice workbookReasoning  practice workbook
Reasoning practice workbookRahul Tiwari
 
Difference between vbscript and javascript
Difference between vbscript and javascriptDifference between vbscript and javascript
Difference between vbscript and javascriptUmar Ali
 
Class diagrams
Class diagramsClass diagrams
Class diagramsNadia_Nazeer
 
MULTI THREADING IN JAVA
MULTI THREADING IN JAVAMULTI THREADING IN JAVA
MULTI THREADING IN JAVAVINOTH R
 

What's hot (20)

Unit 1( modelling concepts & class modeling)
Unit  1( modelling concepts & class modeling)Unit  1( modelling concepts & class modeling)
Unit 1( modelling concepts & class modeling)
 
Evolution and Advancement in Chipsets
Evolution and Advancement in ChipsetsEvolution and Advancement in Chipsets
Evolution and Advancement in Chipsets
 
Multiple Choice Questions on JAVA (object oriented programming) bank 8 -- int...
Multiple Choice Questions on JAVA (object oriented programming) bank 8 -- int...Multiple Choice Questions on JAVA (object oriented programming) bank 8 -- int...
Multiple Choice Questions on JAVA (object oriented programming) bank 8 -- int...
 
Being Functional on Reactive Streams with Spring Reactor
Being Functional on Reactive Streams with Spring ReactorBeing Functional on Reactive Streams with Spring Reactor
Being Functional on Reactive Streams with Spring Reactor
 
Proguard: detecting malicious accounts in social-network-based online promotions
Proguard: detecting malicious accounts in social-network-based online promotionsProguard: detecting malicious accounts in social-network-based online promotions
Proguard: detecting malicious accounts in social-network-based online promotions
 
Rapid application development model
Rapid application development modelRapid application development model
Rapid application development model
 
Making of an Application Specific Integrated Circuit
Making of an Application Specific Integrated CircuitMaking of an Application Specific Integrated Circuit
Making of an Application Specific Integrated Circuit
 
Fundamentals of JAVA
Fundamentals of JAVAFundamentals of JAVA
Fundamentals of JAVA
 
Ch02 process a generic view
Ch02 process a generic viewCh02 process a generic view
Ch02 process a generic view
 
Testing Spring Applications
Testing Spring ApplicationsTesting Spring Applications
Testing Spring Applications
 
Design Patterns - General Introduction
Design Patterns - General IntroductionDesign Patterns - General Introduction
Design Patterns - General Introduction
 
Lecture2
Lecture2Lecture2
Lecture2
 
JPA For Beginner's
JPA For Beginner'sJPA For Beginner's
JPA For Beginner's
 
Threads presentation
Threads presentationThreads presentation
Threads presentation
 
GPGPU Computation
GPGPU ComputationGPGPU Computation
GPGPU Computation
 
Understanding Reactive Programming
Understanding Reactive ProgrammingUnderstanding Reactive Programming
Understanding Reactive Programming
 
Reasoning practice workbook
Reasoning  practice workbookReasoning  practice workbook
Reasoning practice workbook
 
Difference between vbscript and javascript
Difference between vbscript and javascriptDifference between vbscript and javascript
Difference between vbscript and javascript
 
Class diagrams
Class diagramsClass diagrams
Class diagrams
 
MULTI THREADING IN JAVA
MULTI THREADING IN JAVAMULTI THREADING IN JAVA
MULTI THREADING IN JAVA
 

Similar to MCQs Bank on OOP Introduction (40ch

Multiple Choice Questions on JAVA (object oriented programming) bank 3 -- cla...
Multiple Choice Questions on JAVA (object oriented programming) bank 3 -- cla...Multiple Choice Questions on JAVA (object oriented programming) bank 3 -- cla...
Multiple Choice Questions on JAVA (object oriented programming) bank 3 -- cla...Kuntal Bhowmick
 
Multiple Choice Questions on JAVA (object oriented programming) bank 5 -- mem...
Multiple Choice Questions on JAVA (object oriented programming) bank 5 -- mem...Multiple Choice Questions on JAVA (object oriented programming) bank 5 -- mem...
Multiple Choice Questions on JAVA (object oriented programming) bank 5 -- mem...Kuntal Bhowmick
 
Multiple Choice Questions on JAVA (object oriented programming) bank 4 -- loops
Multiple Choice Questions on JAVA (object oriented programming) bank 4 -- loopsMultiple Choice Questions on JAVA (object oriented programming) bank 4 -- loops
Multiple Choice Questions on JAVA (object oriented programming) bank 4 -- loopsKuntal Bhowmick
 
Intro to c# (vs. objective c and java)
Intro to c# (vs. objective c and java)Intro to c# (vs. objective c and java)
Intro to c# (vs. objective c and java)John Smith
 
Intro to c# (vs. objective c and java)
Intro to c# (vs. objective c and java)Intro to c# (vs. objective c and java)
Intro to c# (vs. objective c and java)Wes Yanaga
 
50 common web developer interview questions [2020 updated] [www.full stack....
50 common web developer interview questions [2020 updated]   [www.full stack....50 common web developer interview questions [2020 updated]   [www.full stack....
50 common web developer interview questions [2020 updated] [www.full stack....Alex Ershov
 
Bt0074 oop with java
Bt0074   oop with javaBt0074   oop with java
Bt0074 oop with javasmumbahelp
 
2010 06-24 karlsruher entwicklertag
2010 06-24 karlsruher entwicklertag2010 06-24 karlsruher entwicklertag
2010 06-24 karlsruher entwicklertagMarcel Bruch
 
Java course-in-mumbai
Java course-in-mumbaiJava course-in-mumbai
Java course-in-mumbaivibrantuser
 
Java Multiple Choice Questions and Answers
Java Multiple Choice Questions and AnswersJava Multiple Choice Questions and Answers
Java Multiple Choice Questions and AnswersJava Projects
 
Mca 4030 programming in java
Mca 4030   programming in javaMca 4030   programming in java
Mca 4030 programming in javasmumbahelp
 
Oop suplemnertary september 2019
Oop suplemnertary september  2019Oop suplemnertary september  2019
Oop suplemnertary september 2019ktuonlinenotes
 
Java Standard edition(Java ) programming Basics for beginner's
Java Standard edition(Java ) programming Basics  for beginner'sJava Standard edition(Java ) programming Basics  for beginner's
Java Standard edition(Java ) programming Basics for beginner'smomin6
 
Mcs 024 assignment solution (2020-21)
Mcs 024 assignment solution (2020-21)Mcs 024 assignment solution (2020-21)
Mcs 024 assignment solution (2020-21)smumbahelp
 
Bca 4020 java programming
Bca 4020   java programmingBca 4020   java programming
Bca 4020 java programmingsmumbahelp
 
Mca 4030 programming in java
Mca 4030   programming in javaMca 4030   programming in java
Mca 4030 programming in javasmumbahelp
 
Mca 4030 programming in java
Mca 4030   programming in javaMca 4030   programming in java
Mca 4030 programming in javasmumbahelp
 
XConf 2022 - Code As Data: How data insights on legacy codebases can fill the...
XConf 2022 - Code As Data: How data insights on legacy codebases can fill the...XConf 2022 - Code As Data: How data insights on legacy codebases can fill the...
XConf 2022 - Code As Data: How data insights on legacy codebases can fill the...Alessandro Confetti
 
Mit103 object oriented programming
Mit103  object oriented programmingMit103  object oriented programming
Mit103 object oriented programmingsmumbahelp
 

Similar to MCQs Bank on OOP Introduction (40ch (20)

Multiple Choice Questions on JAVA (object oriented programming) bank 3 -- cla...
Multiple Choice Questions on JAVA (object oriented programming) bank 3 -- cla...Multiple Choice Questions on JAVA (object oriented programming) bank 3 -- cla...
Multiple Choice Questions on JAVA (object oriented programming) bank 3 -- cla...
 
Multiple Choice Questions on JAVA (object oriented programming) bank 5 -- mem...
Multiple Choice Questions on JAVA (object oriented programming) bank 5 -- mem...Multiple Choice Questions on JAVA (object oriented programming) bank 5 -- mem...
Multiple Choice Questions on JAVA (object oriented programming) bank 5 -- mem...
 
Multiple Choice Questions on JAVA (object oriented programming) bank 4 -- loops
Multiple Choice Questions on JAVA (object oriented programming) bank 4 -- loopsMultiple Choice Questions on JAVA (object oriented programming) bank 4 -- loops
Multiple Choice Questions on JAVA (object oriented programming) bank 4 -- loops
 
Intro to c# (vs. objective c and java)
Intro to c# (vs. objective c and java)Intro to c# (vs. objective c and java)
Intro to c# (vs. objective c and java)
 
Intro to c# (vs. objective c and java)
Intro to c# (vs. objective c and java)Intro to c# (vs. objective c and java)
Intro to c# (vs. objective c and java)
 
50 common web developer interview questions [2020 updated] [www.full stack....
50 common web developer interview questions [2020 updated]   [www.full stack....50 common web developer interview questions [2020 updated]   [www.full stack....
50 common web developer interview questions [2020 updated] [www.full stack....
 
Bt0074 oop with java
Bt0074   oop with javaBt0074   oop with java
Bt0074 oop with java
 
2010 06-24 karlsruher entwicklertag
2010 06-24 karlsruher entwicklertag2010 06-24 karlsruher entwicklertag
2010 06-24 karlsruher entwicklertag
 
Java course-in-mumbai
Java course-in-mumbaiJava course-in-mumbai
Java course-in-mumbai
 
Java Multiple Choice Questions and Answers
Java Multiple Choice Questions and AnswersJava Multiple Choice Questions and Answers
Java Multiple Choice Questions and Answers
 
Mca 4030 programming in java
Mca 4030   programming in javaMca 4030   programming in java
Mca 4030 programming in java
 
Oop suplemnertary september 2019
Oop suplemnertary september  2019Oop suplemnertary september  2019
Oop suplemnertary september 2019
 
Javascript Question
Javascript QuestionJavascript Question
Javascript Question
 
Java Standard edition(Java ) programming Basics for beginner's
Java Standard edition(Java ) programming Basics  for beginner'sJava Standard edition(Java ) programming Basics  for beginner's
Java Standard edition(Java ) programming Basics for beginner's
 
Mcs 024 assignment solution (2020-21)
Mcs 024 assignment solution (2020-21)Mcs 024 assignment solution (2020-21)
Mcs 024 assignment solution (2020-21)
 
Bca 4020 java programming
Bca 4020   java programmingBca 4020   java programming
Bca 4020 java programming
 
Mca 4030 programming in java
Mca 4030   programming in javaMca 4030   programming in java
Mca 4030 programming in java
 
Mca 4030 programming in java
Mca 4030   programming in javaMca 4030   programming in java
Mca 4030 programming in java
 
XConf 2022 - Code As Data: How data insights on legacy codebases can fill the...
XConf 2022 - Code As Data: How data insights on legacy codebases can fill the...XConf 2022 - Code As Data: How data insights on legacy codebases can fill the...
XConf 2022 - Code As Data: How data insights on legacy codebases can fill the...
 
Mit103 object oriented programming
Mit103  object oriented programmingMit103  object oriented programming
Mit103 object oriented programming
 

More from Kuntal Bhowmick

Hashing notes data structures (HASHING AND HASH FUNCTIONS)
Hashing notes data structures (HASHING AND HASH FUNCTIONS)Hashing notes data structures (HASHING AND HASH FUNCTIONS)
Hashing notes data structures (HASHING AND HASH FUNCTIONS)Kuntal Bhowmick
 
1. introduction to E-commerce
1. introduction to E-commerce1. introduction to E-commerce
1. introduction to E-commerceKuntal Bhowmick
 
Computer graphics question for exam solved
Computer graphics question for exam solvedComputer graphics question for exam solved
Computer graphics question for exam solvedKuntal Bhowmick
 
DBMS and Rdbms fundamental concepts
DBMS and Rdbms fundamental conceptsDBMS and Rdbms fundamental concepts
DBMS and Rdbms fundamental conceptsKuntal Bhowmick
 
Java questions for interview
Java questions for interviewJava questions for interview
Java questions for interviewKuntal Bhowmick
 
Java Interview Questions
Java Interview QuestionsJava Interview Questions
Java Interview QuestionsKuntal Bhowmick
 
Operating system Interview Questions
Operating system Interview QuestionsOperating system Interview Questions
Operating system Interview QuestionsKuntal Bhowmick
 
Computer Network Interview Questions
Computer Network Interview QuestionsComputer Network Interview Questions
Computer Network Interview QuestionsKuntal Bhowmick
 
C interview questions
C interview  questionsC interview  questions
C interview questionsKuntal Bhowmick
 
Distributed operating systems cs704 a class test
Distributed operating systems cs704 a class testDistributed operating systems cs704 a class test
Distributed operating systems cs704 a class testKuntal Bhowmick
 
Cs291 assignment solution
Cs291 assignment solutionCs291 assignment solution
Cs291 assignment solutionKuntal Bhowmick
 
CS291(C Programming) assignment
CS291(C Programming) assignmentCS291(C Programming) assignment
CS291(C Programming) assignmentKuntal Bhowmick
 
C programming guide new
C programming guide newC programming guide new
C programming guide newKuntal Bhowmick
 
C lecture notes new
C lecture notes newC lecture notes new
C lecture notes newKuntal Bhowmick
 
Shell script assignment 3
Shell script assignment 3Shell script assignment 3
Shell script assignment 3Kuntal Bhowmick
 
Basic shell programs assignment 1
Basic shell programs assignment 1Basic shell programs assignment 1
Basic shell programs assignment 1Kuntal Bhowmick
 
Basic shell programs assignment 1_solution_manual
Basic shell programs assignment 1_solution_manualBasic shell programs assignment 1_solution_manual
Basic shell programs assignment 1_solution_manualKuntal Bhowmick
 
Shell programming assignment 2
Shell programming assignment 2Shell programming assignment 2
Shell programming assignment 2Kuntal Bhowmick
 
Solution manual of shell programming assignment 2
Solution manual of shell programming assignment 2Solution manual of shell programming assignment 2
Solution manual of shell programming assignment 2Kuntal Bhowmick
 

More from Kuntal Bhowmick (20)

Hashing notes data structures (HASHING AND HASH FUNCTIONS)
Hashing notes data structures (HASHING AND HASH FUNCTIONS)Hashing notes data structures (HASHING AND HASH FUNCTIONS)
Hashing notes data structures (HASHING AND HASH FUNCTIONS)
 
1. introduction to E-commerce
1. introduction to E-commerce1. introduction to E-commerce
1. introduction to E-commerce
 
Computer graphics question for exam solved
Computer graphics question for exam solvedComputer graphics question for exam solved
Computer graphics question for exam solved
 
DBMS and Rdbms fundamental concepts
DBMS and Rdbms fundamental conceptsDBMS and Rdbms fundamental concepts
DBMS and Rdbms fundamental concepts
 
Java questions for interview
Java questions for interviewJava questions for interview
Java questions for interview
 
Java Interview Questions
Java Interview QuestionsJava Interview Questions
Java Interview Questions
 
Operating system Interview Questions
Operating system Interview QuestionsOperating system Interview Questions
Operating system Interview Questions
 
Computer Network Interview Questions
Computer Network Interview QuestionsComputer Network Interview Questions
Computer Network Interview Questions
 
C interview questions
C interview  questionsC interview  questions
C interview questions
 
C question
C questionC question
C question
 
Distributed operating systems cs704 a class test
Distributed operating systems cs704 a class testDistributed operating systems cs704 a class test
Distributed operating systems cs704 a class test
 
Cs291 assignment solution
Cs291 assignment solutionCs291 assignment solution
Cs291 assignment solution
 
CS291(C Programming) assignment
CS291(C Programming) assignmentCS291(C Programming) assignment
CS291(C Programming) assignment
 
C programming guide new
C programming guide newC programming guide new
C programming guide new
 
C lecture notes new
C lecture notes newC lecture notes new
C lecture notes new
 
Shell script assignment 3
Shell script assignment 3Shell script assignment 3
Shell script assignment 3
 
Basic shell programs assignment 1
Basic shell programs assignment 1Basic shell programs assignment 1
Basic shell programs assignment 1
 
Basic shell programs assignment 1_solution_manual
Basic shell programs assignment 1_solution_manualBasic shell programs assignment 1_solution_manual
Basic shell programs assignment 1_solution_manual
 
Shell programming assignment 2
Shell programming assignment 2Shell programming assignment 2
Shell programming assignment 2
 
Solution manual of shell programming assignment 2
Solution manual of shell programming assignment 2Solution manual of shell programming assignment 2
Solution manual of shell programming assignment 2
 

Recently uploaded

What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixingviprabot1
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoĂŁo Esperancinha
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 

Recently uploaded (20)

What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixing
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 

MCQs Bank on OOP Introduction (40ch

  • 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