MCQs BANK-1 - Introduction To Object Oriented Programming (Java)
MCQs BANK-1 - Introduction To Object Oriented Programming (Java)
Object Oriented
Programming
Topic: Introduction
MCQs BANK No.: 1
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.
MCQ No: 1
a) Encapsulation
b) Inheritance
c) Message Passing
d) Data Hiding
Page: 2
MCQs Bank on Object Oriented Programming
Topic : Introduction
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
a) Inheritance
b) Encapsulation
c) Data Hiding
d) Message Passing
Page: 4
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 3
a) Single inheritance
b) Multi-level inheritance
c) Multiple inheritance
d) None of these
Page: 6
MCQs Bank on Object Oriented Programming
Topic : Introduction
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
a) True
b) False
Page: 8
MCQs Bank on Object Oriented Programming
Topic : Introduction
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
a) Polymorphism
b) Data Hiding
c) Encapsulation
d) Inheritance
Page: 10
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 6
a) Subclass, Superclass
b) Superclass, Subclass
c) Destructor, Constructor
d) Constructor, Destructor
Page: 12
MCQs Bank on Object Oriented Programming
Topic : Introduction
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.
Page: 14
MCQs Bank on Object Oriented Programming
Topic : Introduction
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
Page: 16
MCQs Bank on Object Oriented Programming
Topic : Introduction
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
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: 10
Page: 20
MCQs Bank on Object Oriented Programming
Topic : Introduction
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
Page: 22
MCQs Bank on Object Oriented Programming
Topic : Introduction
Explanation:
C++ uses compiler only. There is no
use of interpreter in C++ executable
code.
Page: 23
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 12
a) Top Down
b) Bottom Up
c) Random
d) Dynamic
Page: 24
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 13
Page: 26
MCQs Bank on Object Oriented Programming
Topic : Introduction
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.
Page: 27
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 14
a) Dynamic
b) Architecture Neutral
c) Use of pointers
d) Object-oriented
Page: 28
MCQs Bank on Object Oriented Programming
Topic : Introduction
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
a) javap tool
b) javaw command
c) Javadoc tool
d) javah command
Page: 30
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 16
a) Stack
b) String memory
c) Heap memory
d) Random storage space
Page: 32
MCQs Bank on Object Oriented Programming
Topic : Introduction
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
a) package
b) import
c) extends
d) export
Page: 34
MCQs Bank on Object Oriented Programming
Topic : Introduction
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
a) C
b) JAVA
c) C#.NET
d) VB.NET
Page: 36
MCQs Bank on Object Oriented Programming
Topic : Introduction
Ans: a) C
Explanation:
C is NOT Object Oriented
Programming Language, it is
Procedural Programming Language.
Page: 37
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 19
Page: 38
MCQs Bank on Object Oriented Programming
Topic : Introduction
MCQ No: 20
a) Inheritance
b) Abstraction
c) Encapsulation
d) Polymorphism
Page: 40
MCQs Bank on Object Oriented Programming
Topic : Introduction
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