NEW
Font size
WorksheetsObject Oriented Programming/ Java Essentials Pre-Test
Total questions: 49
Worksheet time: 30mins
Polymorphism related to :
PPO
Class
OPP
OOP
Which from the following is a feature that allows us to perform a single action in different ways.
Abstraction
Polymorphism
Encapsulation
Inheritance
The process by which objects of one class acquire the properties of objects of another class is known as
Polymorphism
Inheritance
Data Hiding
Association
Which of the these is the functionality of ‘Encapsulation’?
Binds together code and data
Using single interface for general class of actions
Reduce Complexity
All of the mentioned
What is the main difference between float and double data types?
4.1 is an example of float.
4.11 is an example of double.
Float consists of 8 bytes, and double consists of 4 bytes.
Float consists of 4 bytes, and double consists of 8 bytes.
Which data type is used to create a variable that should store text?
myString
String
Txt
string
How do you insert COMMENTS in Java code?
# This is a comment
/* This is a comment
// This is a comment
Java is short for "JavaScript".
true
false
The value of a string variable can be surrounded by single quotes.
true
false
which one this keywords are used to create a class in java
class
struct
int
none of the avove
which one of the following have elements in insertion order
sorted map
hashmap
linkedhashmap
treemap
which of the following is wrapper class in java
Float
Integer
Double
all of above
Java was originally named:
Coffee
Oak
New C++
Duke
When was Java released?
1975
1985
1995
2005
2015
Who invented Java?
James Gosling
Sergey Brin
Steve Jobs
Bill Gates
Tim Berners-Lee
What was Java originally designed for?
Interactive TV
Internet
Gaming
Cars
Which company owns Java?
Oracle
Microsoft
Apple
Intel
int [] nums = {2, 3, 5, 8, 9, 11};
How would you access the fourth element in nums?
nums[4]
nums[3]
nums(4)
nums(3)
which one of the following is true?
runnable interface declares the start method
Thread.start() method is used to move a thread from a new state to the runnable state
Thread.runnable() method is used to move a thread from new state to the runnable state
Thread.run() method is used to move a thread from new state to the runnable state
Which of the following operator can operate on a Boolean variable?
&&
+=
Out of these methods of the String class, which one can be used for testing the strings for equality?
a. equals()
b. isequal()
equal()
isequals()
Out of these packages, which one contains an abstract keyword?
java.util
java.lang
java.system
java.io
Out of these exceptions, which one is thrown by the compareTo() method that is defined in a double wrapper?
SystemException
ClassCastException
IOException
CastException
Where does the String Pool get stored?
Metaspace
Java Stack
Java Heap
Permanent Generation
Which method can we use in an applet to output a string?
transient()
drawString()
print()
display()
Which method in Java generates boolean random values?
randomBoolean()
nextBoolean()
generateBoolean()
previousBoolean()
. Which mechanism helps in the process of naming as well as visibility control of the classes and their content?
Packages
Interfaces
Object
None of the above
Which statement is true about java ?
Java is a sequence-depended programming language
Java is a code dependent programming language
Java is a platform-dependent programming language
Java is a platform-independent programming language
Which component is used to compile,debug and execute the java programs ?
JRE
JIT
JDK
JVM
Which one of the following is not a java feature
Object-oriented
Use of pointers
Portable
Dynamic and Extensible
Which of these cannot be used for a variable name in java ?
Identifier & keyword
Identifier
Keyword
None of the mentioned
Which of the following is not an OOPS concept in java ?
Polymorphism
Inheritance
Compilation
Encapsulation
Which of these are selection statements in java
Break
Continue
For ( )
If ( )
Which of these keywords is used to define interfaces in java
intf
Intf
interface
Interface
Which of the following is a superclass of every class in java ?
ArrayList
Abstract class
Object class
String
Which of these packages contains the exception stack Overflow in java ?
Which of these statements is incorrect about tread ?
Start() method is used to begin execution of the thread
Run () method is used to begin execution of a thread before start() method in special cases
A thread can be formed by implementing runnable interface only
A thread can be formed by a class that extends thread class
Which of these keywords are used for the block to be examined for exceptions ?
Check
Throw
Catch
Try
Which one of the following is not an access modifier ?
Protected
Void
Public
Private
When does method overloading is determined?
At run time
At compile time
At coding time
At execution time
When overloading does not occur ?
More than one method with same name but different method signature and different number or type of parameters
More than one method with same name,same signature but different number of signature
More than one method with same name,same signature,same number of parameters but different type
More than one method with same , same number of parameters and type but different signature
What is it called if an object has its own life cycle and there is no owner
Aggregation
Composition
Encapsulation
Association
Method overriding is combination of inheritance and polymorphism ?
True
False
Which of the below is invalid identifier with the main method
Public
Static
Private
Final
How can we identify whether a compilation unit is class or interface from a .class file ?
Java source file header
Extension of compilation unit
We cannot different between class and interface
The class or interface name should be postfixed with unit type
What is use of interpreter ?
They covert bytecode to machine language code
They read high level code and execute them
They are intermediated between JIT and JVM
It is a synonym for JIT
