Page 1 of 1
1- We set the path after installing JDK because..
*
It is important to use tools (javac | java etc)
It is good practice
It is used to call main method
2- Which is true for Object oriented programming and Structural programming ?
*
OO programming is Top-down approach and Structural programming is Bottom-up approach
OO programming is Bottom-up approach and Structural programming is Top-down approach
Both are Bottom-up approaches
Both are Top-down approaches
3- Which one contains JIT compiler ?
*
JVM
JDK
JRE
4- Which one is true for classes
*
Classes are primitive datatypes
Classes are non-primitive datatypes
Classes are not datatypes
5- Which one is not used to create an object
*
new keyword
newInstance method
clone method
factory method
class.forName method
deserialization
6- Which statement is not true for constructor
*
constructor can be used to create object without initializing any default or given value
Constructor is used to initialize either default or given values while object creation
7- static variable is used as ?
*
global level variable
instance level variable
class level variable
local level variable
8- Which one is not non-access modifier ?
*
final
abstract
static
transient
protected
synchronized
volatile
9- What is is the type of &= operator ?
*
bitwise operators
assignment operators
relational operators
logical operators
misc operators
10- What is is the type of instanceOf operator ?
*
bitwise operators
assignment operators
relational operators
logical operators
misc operators
11- What is inBoxing/Boxing is java ?
*
Assigning value of one datatype to another datatype
Assigning value of primitive datatype to non-primitive datatype
Assigning value of non-primitive datatype to primitive datatype
none of above
12- Static nested class is related to ?
*
Instance inner class
Local inner class
Anonymous inner class
none of above
13- Which is preferred way to import ?
*
Using fully qualified name
by importing package.class
by importing full package
14- Which statement is not true ?
*
Importing package does not include subpackages
Importing package includes subpackages automatically
static member can also be imported using static import
15- which statement is true for relationship in classes ?
*
Inheritance is IS-A relationship and Association is HAS-A relationship
Inheritance is HAS-A relationship and Association is IS-A relationship
Both are IS-A relationship
Both are HAS-A relationship
16- Method overloading includes this rule
*
Parameter must be same
return type must be same
return type must be different
at least 2 classes are required
17- Which statement is correct for abstraction ?
*
Focus on "what" object does and not on "how" it does
Focus on "how" object does and not on "what" it does
Focus on both "what" object does and "what" it does
Focus on both "how" object does and "how" it does
18- Which statement is correct for encapsulation ?
*
Data members are private and their access methods are public
Data members are public and their access methods are private
Both Data members and their access methods are public
Both Data members and their access methods are private
19- which statement is true ?
*
this and super both refers to parent class
this and super both refers to current class
this keyword refers to current class and super keyword refers to parent class
this keyword refers to parent class and super keyword refers to current class
20 - which statement is true for Interface ?
*
All data members are private and final
All data members are public and static
All data members are private and static
All data members are public static and final
21- Which statement is true for Interface ?
*
All methods are private and abstract
All methods are public and abstract
All methods are public and abstract and final
All methods are abstract and final
22- Which statement is true for Array in java ?
*
Array can include different type of elements and it is fixed data structure
Array can only include similar type of elements and it is dynamic data structure
Array can include only similar type of elements and it is fixed data structure
Array can include different type of elements and it is dynamic data structure
23- How many Object are created for String s1 = new String("Here");String s2 = new String("Here"); ?
*
1
2
3
4
24- Which statement is true for String, StringBuilder and StringBuffer ?
*
String is not thread safe a but StringBuilder and StringBuffer are thread safe
String is thread safe a but StringBuilder and StringBuffer are not thread safe
String and StringBuilder are not thread safe a but StringBuffer is thread safe
25- Which statement is true for Collection framework in java?
*
Map interface extends Collection interface
Map interface extends Iterable interface
Iterable interface extends Collection interface
26- Which statement is true for Exception handling in java ?
*
Runtime Exception extends Throwable
Runtime Exception implements Throwable
Exception extends Throwable
Exception implements Throwable
27- Which statement is true for I/O package ?
*
Input stream of byte stream = writer streams of character stream
Input stream of byte stream = reader streams of character stream
none of above
28- Which one is preferred way of creating thread ?
*
By extending Thread
By implementing Thread
By extending Runnable
By implementing Runnable
29- Which statement is true for JDBC ?
*
Statement extends PreparedStatement extends Callalble
PreparedStatement extends CallableStatement extends Statement
CallableStatement extends Statement extends PreaparedStatement
CallableStatement extends PreparedStatement extends Statement
30 - Prepared statements are more secure because they use bind variables, which can prevent SQL injection attack.
*
True
False
Page 1 of 1