SlideShare a Scribd company logo
1 of 45
Download to read offline
MCQs BANK
Page: 1
Object Oriented
Programming
Topic: Basic OOP concepts
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.: 2
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 1
When you program for the Java
platform, you write source code in
_________ files. Fill in the blank.
a) .class
b) .cpp
c) .java
d) .html
Page: 2
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 1 (Solution)
Ans: c) .java
Explanation:
When you program for the Java
platform, you write source code in
.java files and then compile them.
Page: 3
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 2
The java compiler checks your java
code against the language's syntax
rules, then writes out bytecodes in
________ files. Fill in the blank.
a) .class
b) .java
c) .exe
d) .obj
Page: 4
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 2 (Solution)
Ans: a) .class
Explanation: The compiler checks
your code against the language's
syntax rules, then writes out
bytecodes in .class files.
Page: 5
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 3
Which of the following files the
JVM(Java virtual machine) reads
and interprets?
a) .class
b) .java
c) .exe
d) .obj
Page: 6
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 3 (Solution)
Ans: a) .class
Explanation:
At run time, the JVM reads and
interprets .class files and executes
the program's instructions on the
native hardware platform for which
the JVM was written.
Page: 7
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 4
Identify the correct match
combination.
a) 1-x, 2-w, 3-z, 4-y
b) 1-w, 2-x, 3-z, 4-y
c) 1-x, 2-w, 3-y, 4-z
d) 1-y, 2-w, 3-z, 4-x
Page: 8
1) JVM w) Implicit memory
management
2) Garbage
collection
x) Bytecode
3) Objects y) Pool of memory
4) Heap z) Instance variables
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 4 (Solution)
Ans: a) 1-x, 2-w, 3-z, 4-y
Explanation: At run time, the JVM reads
and interprets Bytecode ( in .class files) and
executes the program's instructions on the
native hardware platform for which the JVM
was written.
When your Java application creates an object
instance at run time, the JVM automatically
allocates memory space for that object from
the heap, which is a pool of memory set
aside for your program to use. The Java
garbage collector runs in the background,
keeping track of which objects the application
no longer needs and reclaiming memory from
them. This approach to memory handling is
called implicit memory management because
it doesn't require you to write any memory-
handling code. Data field members of an
object is called instance variables.
Page: 9
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 5
Which of the following process is
used by objects for communication
and coordination.
a) method calling
b) shared memory
c) stack
d) interpreter
Page: 10
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 5 (Solution)
Ans: a) method calling
Explanation: Objects talk to other
objects by sending messages
(method calls in the Java language).
Page: 11
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 6
____________ access means the
object's attributes are accessible
only within the object itself. Fill in
the blank.
a) private
b) public
c) protected
d) default
Page: 12
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 6 (Solution)
Ans: a) private
Explanation:
On the Java platform, you can use
access specifiers to vary the
nature of object relationships from
public to private.
Public access is wide open,
whereas private access means the
object's attributes are accessible
only within the object itself.
Page: 13
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 7
OOP introduces the concept of
inheritance, where a subclass can
"copy" the attributes and behavior of
the super class. If some of those
attributes or behaviors need to
changed in subclass, then you need
to __________ them. Fill in the
blank.
a) overload
b) override
c) delete
d) integrate
Page: 14
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 7 (Solution)
Ans: b) override
Explanation:
Overriding is a feature that allows a
subclass or child class to provide a
specific implementation of a method
that is already provided by one of its
super-classes or parent classes.
You only change what you need to
change in order to create
specialized objects.
Page: 15
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 8
Which of the following is a
fundamental feature of object-
oriented programming language?
a) automatic garbage collection
b) creating objects and manipulating
objects
c) platform independence
d) all of the above
Page: 16
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 8 (Solution)
Ans: b) creating objects and
manipulating objects
Explanation:
Object-oriented programming is
centered on creating objects,
manipulating objects, and making
objects work together.
This allows you to create modular
programs and reusable code. It is the
fundamental feature of Object-oriented
programming languages.
Automatic garbage collection and
platform independence are features
specific to java(not present in all OOP
language, such as C++).
Page: 17
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 9
Which of the following gives
platform independence to java
programs?
a) Bytecode
b) JVM
c) Both (a) and (b)
d) None of these
Page: 18
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 9 (Solution)
Ans: c) Both (a) and (b)
Explanation: JVM is needed in
order to run Java programs. The
programs are compiled into Java
Virtual Machine code called
bytecode.
The bytecode is machine
independent and is able to run on
any machine that has a Java Virtual
Machine. With Java, the program
need only be compiled once, and the
bytecode generated by the Java
compiler can run on any platform.
Page: 19
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 10
______________ is the capability for
a program to perform several tasks
simultaneously within a program. Fill
in the blank.
a) Polymorphism
b) Multithreading
c) Exception Handling
d) Platform Independence
Page: 20
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 10 (Solution)
Ans: b) Multithreading
Explanation:
Multithreading is the capability for a
program to perform several tasks
simultaneously within a program. In
Java, multithreaded programming
has been smoothly integrated into it,
while in other languages, operating
system-specific procedures have to
be called in order to enable
multithreading. Multithreading is a
necessity in visual and network -
programming.
Page: 21
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 11
Consider the following 2
statements(S1 and S2).
(S1) byte data type is a 8-bit signed
two's complement integer.
(S2) Default value is 0.
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: Basic OOP concepts
MCQ No: 11 (Solution)
Ans: c) Both S1 and S2 are TRUE
Explanation:
byte data type is a 8-bit signed two's
complement integer.
Minimum value is -128 (-2^7)
Maximum value is 127
(inclusive)(2^7 -1)
Default value is 0
Page: 23
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 12
byte data type in java is used to
save space in large arrays, mainly
in place of integers, since a byte is
______ times smaller than an int.
Fill in the blank.
a) two
b) three
c) four
d) eight
Page: 24
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 12 (Solution)
Ans: c) four
Explanation:
Byte data type is used to save space
in large arrays, mainly in place of
integers, since a byte is four times
smaller than an int.
Int data type is a 32-bit signed two's
complement integer in java.
Page: 25
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 13
Consider the following 2
statements(S1 and S2).
(S1) short data type is a 16-bit
signed two's complement integer.
(S2) Default value is 1.
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: Basic OOP concepts
MCQ No: 13 (Solution)
Ans: a) S1 is TRUE and S2 is FALSE
Explanation:
Short data type is a 16-bit signed
two's complement integer.
Minimum value is -32,768 (-2^15)
Maximum value is 32,767(inclusive)
(2^15 -1)
Default value is 0.
Example :
short s= 10000 , short r = -20000
Page: 27
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 14
Short data type can also be used
to save memory as byte data type.
A short is ____ times smaller than
an int. Fill in the blank.
a) 2
b) 3
c) 4
d) 8
Page: 28
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 14 (Solution)
Ans: a) 2
Explanation:
Short data type can also be used to
save memory as byte data type. A
short is 2 times smaller than an int.
int is of 32 bit whereas short is of 16
bit.
Page: 29
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 15
Long data type is a ________
signed two's complement integer.
Fill in the blank.
a) 8 bit
b) 16 bit
c) 32 bit
d) 64 bit
Page: 30
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 15 (Solution)
Ans: d) 64 bit
Explanation:
Long data type is a 64-bit signed
two's complement integer. This type
is used when a wider range than int
is needed.
Page: 31
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 16
Consider the following 2
statements(S1 and S2).
(S1) int data type is a 32-bit signed
two's complement integer.
(S2) Default value is 1.
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: 32
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 16 (Solution)
Ans: a) S1 is TRUE and S2 is FALSE
Explanation:
Int data type is a 32-bit signed two's
complement integer.
Int is generally used as the default
data type for integral values unless
there is a concern about memory.
The default value is 0.
Example :
int a = 100000, int b = -200000
Page: 33
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 17
Which among the following data
types in JAVA has the largest
memory size?
a) int
b) short
c) byte
d) long
Page: 34
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 17 (Solution)
Ans: d) long
Explanation:
Long data type is a 64-bit signed
two's complement integer.
This type is used when a wider
range than int is needed. Short is 16
bit in size. Byte 8 bit and int is 32 bit
in size.
Page: 35
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 18
Consider the following 2
statements(S1 and S2).
(S1) float data type is a single-
precision 32-bit floating point.
(S2) double data type is a double-
precision 64-bit floating point.
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: 36
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 18 (Solution)
Ans: c) Both S1 and S2 are TRUE
Explanation:
Float data type is a single-precision 32-bit
floating point.
Float is mainly used to save memory in
large arrays of floating point numbers.
Default value is 0.0f.
Example : float f1 = 234.5f
double data type is a double-precision 64-
bit floating point.
This data type is generally used as the
default data type for decimal values.
generally the default choice.
Default value is 0.0d.
Example : double d1 = 123.4
Page: 37
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 19
Consider the following 2
statements(S1 and S2).
(S1) boolean data type represents
one bit of information
(S2) There are only two possible
values of boolean data type : true
and false.
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: 38
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 19 (Solution)
Ans: c) Both S1 and S2 are TRUE
Explanation:
boolean data type represents one bit
of information.
There are only two possible values :
true and false.
This data type is used for simple flags
that track true/false conditions.
Default value is false.
Example : boolean one = true
Page: 39
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 20
char data type in java is a single
__________ Unicode character.
Fill in the blank.
a) 8-bit
b) 16-bit
c) 32-bit
d) 64-bit
Page: 40
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 20 (Solution)
Ans: b) 16-bit
Explanation: char data type is a single
16-bit Unicode character.
Minimum value is 'u0000' (or 0).
Maximum value is 'uffff' (or 65,535
inclusive).
Char data type is used to store any
character.
Example . char letterA ='A'.
Unicode is a 16-bit character encoding
standard and is capable to represent
almost every character of well-known
languages of the world. Before Unicode,
there were multiple standards to
represent character encoding − ASCII -
for the United States.
Page: 41
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 21
What is the default value of
boolean data type in Java?
a) 1
b) 0
c) true
d) false
Page: 42
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 21 (Solution)
Ans: d) false
Explanation:
boolean data type represents one bit
of information.
There are only two possible values :
true and false.
This data type is used for simple
flags that track true/false conditions.
Default value is false.
Page: 43
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 22
What is the default value of a
reference variable in java?
a) Garbage Value
b) Null Value
c) Zero
d) One
Page: 44
MCQs Bank on Object Oriented Programming
Topic: Basic OOP concepts
MCQ No: 22 (Solution)
Ans: b) Null Value
Explanation:
Reference variable is used to point
object/values. Classes, interfaces,
arrays, enumerations, and,
annotations are reference types in
Java. In simple words, a reference
variable holds a reference to
information related to that variable. A
reference is an address that indicates
where an object's variables and
methods are stored.
Default value of any reference
variable is null.
Page: 45

More Related Content

What's hot

deadlock avoidance
deadlock avoidancedeadlock avoidance
deadlock avoidancewahab13
 
Object Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaionObject Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaionPritom Chaki
 
Activity diagram-UML diagram
Activity diagram-UML diagramActivity diagram-UML diagram
Activity diagram-UML diagramRamakant Soni
 
dos mutual exclusion algos
dos mutual exclusion algosdos mutual exclusion algos
dos mutual exclusion algosAkhil Sharma
 
Multiversion Concurrency Control Techniques
Multiversion Concurrency Control TechniquesMultiversion Concurrency Control Techniques
Multiversion Concurrency Control TechniquesRaj vardhan
 
classes and objects in C++
classes and objects in C++classes and objects in C++
classes and objects in C++HalaiHansaika
 
Remote Method Invocation (RMI)
Remote Method Invocation (RMI)Remote Method Invocation (RMI)
Remote Method Invocation (RMI)Peter R. Egli
 
JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivityTanmoy Barman
 
System call (Fork +Exec)
System call (Fork +Exec)System call (Fork +Exec)
System call (Fork +Exec)Amit Ghosh
 
Java abstract class & abstract methods
Java abstract class & abstract methodsJava abstract class & abstract methods
Java abstract class & abstract methodsShubham Dwivedi
 
RPC: Remote procedure call
RPC: Remote procedure callRPC: Remote procedure call
RPC: Remote procedure callSunita Sahu
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process CommunicationAdeel Rasheed
 
Control structures in java
Control structures in javaControl structures in java
Control structures in javaVINOTH R
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented ProgrammingIqra khalil
 
Java Notes by C. Sreedhar, GPREC
Java Notes by C. Sreedhar, GPRECJava Notes by C. Sreedhar, GPREC
Java Notes by C. Sreedhar, GPRECSreedhar Chowdam
 

What's hot (20)

Introduction to ns2
Introduction to ns2Introduction to ns2
Introduction to ns2
 
Processes and threads
Processes and threadsProcesses and threads
Processes and threads
 
Applets in java
Applets in javaApplets in java
Applets in java
 
deadlock avoidance
deadlock avoidancedeadlock avoidance
deadlock avoidance
 
Object Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaionObject Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaion
 
Activity diagram-UML diagram
Activity diagram-UML diagramActivity diagram-UML diagram
Activity diagram-UML diagram
 
dos mutual exclusion algos
dos mutual exclusion algosdos mutual exclusion algos
dos mutual exclusion algos
 
Architecture of Linux
 Architecture of Linux Architecture of Linux
Architecture of Linux
 
Multiversion Concurrency Control Techniques
Multiversion Concurrency Control TechniquesMultiversion Concurrency Control Techniques
Multiversion Concurrency Control Techniques
 
classes and objects in C++
classes and objects in C++classes and objects in C++
classes and objects in C++
 
Remote Method Invocation (RMI)
Remote Method Invocation (RMI)Remote Method Invocation (RMI)
Remote Method Invocation (RMI)
 
JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivity
 
System call (Fork +Exec)
System call (Fork +Exec)System call (Fork +Exec)
System call (Fork +Exec)
 
Java abstract class & abstract methods
Java abstract class & abstract methodsJava abstract class & abstract methods
Java abstract class & abstract methods
 
RPC: Remote procedure call
RPC: Remote procedure callRPC: Remote procedure call
RPC: Remote procedure call
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
 
Control structures in java
Control structures in javaControl structures in java
Control structures in java
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented Programming
 
Java Notes by C. Sreedhar, GPREC
Java Notes by C. Sreedhar, GPRECJava Notes by C. Sreedhar, GPREC
Java Notes by C. Sreedhar, GPREC
 
Delegates and events in C#
Delegates and events in C#Delegates and events in C#
Delegates and events in C#
 

Similar to Multiple Choice Questions on JAVA (object oriented programming) bank 2 -- basic oop concepts

Multiple Choice Questions on JAVA (object oriented programming) bank 1 -- int...
Multiple Choice Questions on JAVA (object oriented programming) bank 1 -- int...Multiple Choice Questions on JAVA (object oriented programming) bank 1 -- int...
Multiple Choice Questions on JAVA (object oriented programming) bank 1 -- int...Kuntal Bhowmick
 
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
 
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
 
Learning to Spot and Refactor Inconsistent Method Names
Learning to Spot and Refactor Inconsistent Method NamesLearning to Spot and Refactor Inconsistent Method Names
Learning to Spot and Refactor Inconsistent Method NamesDongsun Kim
 
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
 
ASE2023_SCPatcher_Presentation_V5.pptx
ASE2023_SCPatcher_Presentation_V5.pptxASE2023_SCPatcher_Presentation_V5.pptx
ASE2023_SCPatcher_Presentation_V5.pptxjzyNick
 
Migrating from OpenGL to Vulkan
Migrating from OpenGL to VulkanMigrating from OpenGL to Vulkan
Migrating from OpenGL to VulkanMark Kilgard
 
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
 
Java Multiple Choice Questions and Answers
Java Multiple Choice Questions and AnswersJava Multiple Choice Questions and Answers
Java Multiple Choice Questions and AnswersJava Projects
 
OpenCV @ Droidcon 2012
OpenCV @ Droidcon 2012OpenCV @ Droidcon 2012
OpenCV @ Droidcon 2012Wingston
 
Bt0074 oop with java
Bt0074   oop with javaBt0074   oop with java
Bt0074 oop with javasmumbahelp
 
The Little Unicorn That Could
The Little Unicorn That CouldThe Little Unicorn That Could
The Little Unicorn That CouldPVS-Studio
 
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...NicheTech Com. Solutions Pvt. Ltd.
 
alphablues - ML applied to text and image in chat bots
alphablues - ML applied to text and image in chat botsalphablues - ML applied to text and image in chat bots
alphablues - ML applied to text and image in chat botsAndré Karpištšenko
 
Don't Call It a Comeback: Attribute Grammars for Big Data Visualization
Don't Call It a Comeback: Attribute Grammars for Big Data VisualizationDon't Call It a Comeback: Attribute Grammars for Big Data Visualization
Don't Call It a Comeback: Attribute Grammars for Big Data VisualizationLeo Meyerovich
 
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
 

Similar to Multiple Choice Questions on JAVA (object oriented programming) bank 2 -- basic oop concepts (20)

Multiple Choice Questions on JAVA (object oriented programming) bank 1 -- int...
Multiple Choice Questions on JAVA (object oriented programming) bank 1 -- int...Multiple Choice Questions on JAVA (object oriented programming) bank 1 -- int...
Multiple Choice Questions on JAVA (object oriented programming) bank 1 -- int...
 
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
 
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....
 
Learning to Spot and Refactor Inconsistent Method Names
Learning to Spot and Refactor Inconsistent Method NamesLearning to Spot and Refactor Inconsistent Method Names
Learning to Spot and Refactor Inconsistent Method Names
 
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...
 
ASE2023_SCPatcher_Presentation_V5.pptx
ASE2023_SCPatcher_Presentation_V5.pptxASE2023_SCPatcher_Presentation_V5.pptx
ASE2023_SCPatcher_Presentation_V5.pptx
 
Migrating from OpenGL to Vulkan
Migrating from OpenGL to VulkanMigrating from OpenGL to Vulkan
Migrating from OpenGL to Vulkan
 
OpenCV+Android.pptx
OpenCV+Android.pptxOpenCV+Android.pptx
OpenCV+Android.pptx
 
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...
 
Java Multiple Choice Questions and Answers
Java Multiple Choice Questions and AnswersJava Multiple Choice Questions and Answers
Java Multiple Choice Questions and Answers
 
OpenCV @ Droidcon 2012
OpenCV @ Droidcon 2012OpenCV @ Droidcon 2012
OpenCV @ Droidcon 2012
 
Bt0074 oop with java
Bt0074   oop with javaBt0074   oop with java
Bt0074 oop with java
 
Portfolio
PortfolioPortfolio
Portfolio
 
The Little Unicorn That Could
The Little Unicorn That CouldThe Little Unicorn That Could
The Little Unicorn That Could
 
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
 
alphablues - ML applied to text and image in chat bots
alphablues - ML applied to text and image in chat botsalphablues - ML applied to text and image in chat bots
alphablues - ML applied to text and image in chat bots
 
Don't Call It a Comeback: Attribute Grammars for Big Data Visualization
Don't Call It a Comeback: Attribute Grammars for Big Data VisualizationDon't Call It a Comeback: Attribute Grammars for Big Data Visualization
Don't Call It a Comeback: Attribute Grammars for Big Data Visualization
 
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)
 

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
 
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
 
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

Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
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
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
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
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
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
 
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
 
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
 
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
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 

Recently uploaded (20)

Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
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
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
🔝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...
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
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
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
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
 
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...
 
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
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
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
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 

Multiple Choice Questions on JAVA (object oriented programming) bank 2 -- basic oop concepts

  • 1. MCQs BANK Page: 1 Object Oriented Programming Topic: Basic OOP concepts 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.: 2
  • 2. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 1 When you program for the Java platform, you write source code in _________ files. Fill in the blank. a) .class b) .cpp c) .java d) .html Page: 2
  • 3. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 1 (Solution) Ans: c) .java Explanation: When you program for the Java platform, you write source code in .java files and then compile them. Page: 3
  • 4. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 2 The java compiler checks your java code against the language's syntax rules, then writes out bytecodes in ________ files. Fill in the blank. a) .class b) .java c) .exe d) .obj Page: 4
  • 5. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 2 (Solution) Ans: a) .class Explanation: The compiler checks your code against the language's syntax rules, then writes out bytecodes in .class files. Page: 5
  • 6. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 3 Which of the following files the JVM(Java virtual machine) reads and interprets? a) .class b) .java c) .exe d) .obj Page: 6
  • 7. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 3 (Solution) Ans: a) .class Explanation: At run time, the JVM reads and interprets .class files and executes the program's instructions on the native hardware platform for which the JVM was written. Page: 7
  • 8. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 4 Identify the correct match combination. a) 1-x, 2-w, 3-z, 4-y b) 1-w, 2-x, 3-z, 4-y c) 1-x, 2-w, 3-y, 4-z d) 1-y, 2-w, 3-z, 4-x Page: 8 1) JVM w) Implicit memory management 2) Garbage collection x) Bytecode 3) Objects y) Pool of memory 4) Heap z) Instance variables
  • 9. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 4 (Solution) Ans: a) 1-x, 2-w, 3-z, 4-y Explanation: At run time, the JVM reads and interprets Bytecode ( in .class files) and executes the program's instructions on the native hardware platform for which the JVM was written. When your Java application creates an object instance at run time, the JVM automatically allocates memory space for that object from the heap, which is a pool of memory set aside for your program to use. The Java garbage collector runs in the background, keeping track of which objects the application no longer needs and reclaiming memory from them. This approach to memory handling is called implicit memory management because it doesn't require you to write any memory- handling code. Data field members of an object is called instance variables. Page: 9
  • 10. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 5 Which of the following process is used by objects for communication and coordination. a) method calling b) shared memory c) stack d) interpreter Page: 10
  • 11. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 5 (Solution) Ans: a) method calling Explanation: Objects talk to other objects by sending messages (method calls in the Java language). Page: 11
  • 12. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 6 ____________ access means the object's attributes are accessible only within the object itself. Fill in the blank. a) private b) public c) protected d) default Page: 12
  • 13. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 6 (Solution) Ans: a) private Explanation: On the Java platform, you can use access specifiers to vary the nature of object relationships from public to private. Public access is wide open, whereas private access means the object's attributes are accessible only within the object itself. Page: 13
  • 14. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 7 OOP introduces the concept of inheritance, where a subclass can "copy" the attributes and behavior of the super class. If some of those attributes or behaviors need to changed in subclass, then you need to __________ them. Fill in the blank. a) overload b) override c) delete d) integrate Page: 14
  • 15. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 7 (Solution) Ans: b) override Explanation: Overriding is a feature that allows a subclass or child class to provide a specific implementation of a method that is already provided by one of its super-classes or parent classes. You only change what you need to change in order to create specialized objects. Page: 15
  • 16. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 8 Which of the following is a fundamental feature of object- oriented programming language? a) automatic garbage collection b) creating objects and manipulating objects c) platform independence d) all of the above Page: 16
  • 17. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 8 (Solution) Ans: b) creating objects and manipulating objects Explanation: Object-oriented programming is centered on creating objects, manipulating objects, and making objects work together. This allows you to create modular programs and reusable code. It is the fundamental feature of Object-oriented programming languages. Automatic garbage collection and platform independence are features specific to java(not present in all OOP language, such as C++). Page: 17
  • 18. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 9 Which of the following gives platform independence to java programs? a) Bytecode b) JVM c) Both (a) and (b) d) None of these Page: 18
  • 19. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 9 (Solution) Ans: c) Both (a) and (b) Explanation: JVM is needed in order to run Java programs. The programs are compiled into Java Virtual Machine code called bytecode. The bytecode is machine independent and is able to run on any machine that has a Java Virtual Machine. With Java, the program need only be compiled once, and the bytecode generated by the Java compiler can run on any platform. Page: 19
  • 20. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 10 ______________ is the capability for a program to perform several tasks simultaneously within a program. Fill in the blank. a) Polymorphism b) Multithreading c) Exception Handling d) Platform Independence Page: 20
  • 21. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 10 (Solution) Ans: b) Multithreading Explanation: Multithreading is the capability for a program to perform several tasks simultaneously within a program. In Java, multithreaded programming has been smoothly integrated into it, while in other languages, operating system-specific procedures have to be called in order to enable multithreading. Multithreading is a necessity in visual and network - programming. Page: 21
  • 22. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 11 Consider the following 2 statements(S1 and S2). (S1) byte data type is a 8-bit signed two's complement integer. (S2) Default value is 0. 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: Basic OOP concepts MCQ No: 11 (Solution) Ans: c) Both S1 and S2 are TRUE Explanation: byte data type is a 8-bit signed two's complement integer. Minimum value is -128 (-2^7) Maximum value is 127 (inclusive)(2^7 -1) Default value is 0 Page: 23
  • 24. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 12 byte data type in java is used to save space in large arrays, mainly in place of integers, since a byte is ______ times smaller than an int. Fill in the blank. a) two b) three c) four d) eight Page: 24
  • 25. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 12 (Solution) Ans: c) four Explanation: Byte data type is used to save space in large arrays, mainly in place of integers, since a byte is four times smaller than an int. Int data type is a 32-bit signed two's complement integer in java. Page: 25
  • 26. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 13 Consider the following 2 statements(S1 and S2). (S1) short data type is a 16-bit signed two's complement integer. (S2) Default value is 1. 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: Basic OOP concepts MCQ No: 13 (Solution) Ans: a) S1 is TRUE and S2 is FALSE Explanation: Short data type is a 16-bit signed two's complement integer. Minimum value is -32,768 (-2^15) Maximum value is 32,767(inclusive) (2^15 -1) Default value is 0. Example : short s= 10000 , short r = -20000 Page: 27
  • 28. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 14 Short data type can also be used to save memory as byte data type. A short is ____ times smaller than an int. Fill in the blank. a) 2 b) 3 c) 4 d) 8 Page: 28
  • 29. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 14 (Solution) Ans: a) 2 Explanation: Short data type can also be used to save memory as byte data type. A short is 2 times smaller than an int. int is of 32 bit whereas short is of 16 bit. Page: 29
  • 30. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 15 Long data type is a ________ signed two's complement integer. Fill in the blank. a) 8 bit b) 16 bit c) 32 bit d) 64 bit Page: 30
  • 31. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 15 (Solution) Ans: d) 64 bit Explanation: Long data type is a 64-bit signed two's complement integer. This type is used when a wider range than int is needed. Page: 31
  • 32. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 16 Consider the following 2 statements(S1 and S2). (S1) int data type is a 32-bit signed two's complement integer. (S2) Default value is 1. 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: 32
  • 33. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 16 (Solution) Ans: a) S1 is TRUE and S2 is FALSE Explanation: Int data type is a 32-bit signed two's complement integer. Int is generally used as the default data type for integral values unless there is a concern about memory. The default value is 0. Example : int a = 100000, int b = -200000 Page: 33
  • 34. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 17 Which among the following data types in JAVA has the largest memory size? a) int b) short c) byte d) long Page: 34
  • 35. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 17 (Solution) Ans: d) long Explanation: Long data type is a 64-bit signed two's complement integer. This type is used when a wider range than int is needed. Short is 16 bit in size. Byte 8 bit and int is 32 bit in size. Page: 35
  • 36. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 18 Consider the following 2 statements(S1 and S2). (S1) float data type is a single- precision 32-bit floating point. (S2) double data type is a double- precision 64-bit floating point. 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: 36
  • 37. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 18 (Solution) Ans: c) Both S1 and S2 are TRUE Explanation: Float data type is a single-precision 32-bit floating point. Float is mainly used to save memory in large arrays of floating point numbers. Default value is 0.0f. Example : float f1 = 234.5f double data type is a double-precision 64- bit floating point. This data type is generally used as the default data type for decimal values. generally the default choice. Default value is 0.0d. Example : double d1 = 123.4 Page: 37
  • 38. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 19 Consider the following 2 statements(S1 and S2). (S1) boolean data type represents one bit of information (S2) There are only two possible values of boolean data type : true and false. 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: 38
  • 39. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 19 (Solution) Ans: c) Both S1 and S2 are TRUE Explanation: boolean data type represents one bit of information. There are only two possible values : true and false. This data type is used for simple flags that track true/false conditions. Default value is false. Example : boolean one = true Page: 39
  • 40. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 20 char data type in java is a single __________ Unicode character. Fill in the blank. a) 8-bit b) 16-bit c) 32-bit d) 64-bit Page: 40
  • 41. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 20 (Solution) Ans: b) 16-bit Explanation: char data type is a single 16-bit Unicode character. Minimum value is 'u0000' (or 0). Maximum value is 'uffff' (or 65,535 inclusive). Char data type is used to store any character. Example . char letterA ='A'. Unicode is a 16-bit character encoding standard and is capable to represent almost every character of well-known languages of the world. Before Unicode, there were multiple standards to represent character encoding − ASCII - for the United States. Page: 41
  • 42. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 21 What is the default value of boolean data type in Java? a) 1 b) 0 c) true d) false Page: 42
  • 43. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 21 (Solution) Ans: d) false Explanation: boolean data type represents one bit of information. There are only two possible values : true and false. This data type is used for simple flags that track true/false conditions. Default value is false. Page: 43
  • 44. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 22 What is the default value of a reference variable in java? a) Garbage Value b) Null Value c) Zero d) One Page: 44
  • 45. MCQs Bank on Object Oriented Programming Topic: Basic OOP concepts MCQ No: 22 (Solution) Ans: b) Null Value Explanation: Reference variable is used to point object/values. Classes, interfaces, arrays, enumerations, and, annotations are reference types in Java. In simple words, a reference variable holds a reference to information related to that variable. A reference is an address that indicates where an object's variables and methods are stored. Default value of any reference variable is null. Page: 45