Object Oriented Programming through Java - Unit-1
Correct Answer
JVM
ALocal variables
BInstance variables
CClass Variables
DStatic variables
Correct Answer
Instance variables
A//Some comments
BSome comments//
C/*Some comments*/
D*/Some comments/*
Correct Answer
//Some comments
A0-9
BA-Z, a-z
C$, _ (Underscore)
DAll the above
Correct Answer
All the above
Correct Answer
/* */
APre-defined data types
BUser-defined data types
CBoth
DNone of the above
Correct Answer
Pre-defined data types
Aint Abc = 12;
BString full_name = "yourname";
Cfloat 4d = 12.3f;
Ddouble d$ = 1234.456d;
Correct Answer
float 4d = 12.3f;
Ainside the method
Binside class but outside the method
Cinside class but outside the method and it is static
Doutside the class
Correct Answer
inside class but outside the method
AType Conversion
BImplicit conversion
CType Casting
DNone of the above
Correct Answer
Type Casting
AA constructor must have the same name as the class it is declared within.
BA constructor is used to Initialize the objects.
CA constructor may be declared private
DAll of the above
Correct Answer
All of the above
Aswitch, case
Bdefault
Cbreak
DAll
Correct Answer
All
Abreak - immediately jumps to end of the loop
Bcontinue - immediately jumps to next interation
Cwhile loop - if the number of iterations are not fixed
Dfor loop - if the number of iterations are not fixed
Correct Answer
for loop - if the number of iterations are not fixed
ADatatype array_name[] = new DataType[size];
BDatatype[] array_name = new DataType[size];
CDatatype array_name[] = {val1,val2,val3,......valn};
DDatatype array_name[] = new DataType[];
Correct Answer
Datatype array_name[] = new DataType[];
Aan object
Ba variable
Ca method
Dan array
Correct Answer
an object
Ajava.io
Bjava.lang
Cjava.util
Djava.String
Correct Answer
java.lang
Ajava.io
Bjava.lang
Cjava.util
Djava.String
Correct Answer
java.lang
Ajava.io
Bjava.lang
Cjava.util
Djava.String
Correct Answer
java.util
Ajava.io
Bjava.lang
Cjava.util
Djava.String
Correct Answer
java.io
AIt is necessary to use new operator to initialize an array
BArray can be initialized using comma separated expressions surrounded by curly braces
CArray can be initialized when they are declared
DNone of the mentioned
Correct Answer
None of the mentioned
Correct Answer
1
AInheritance
BPolymorphism
CEncapsulation
DNone
Correct Answer
Polymorphism
Fill in the Blanks
22
To successfully overload a method in Java, the argument-list or parameter-list must be ___. (Same/Different)
Correct Answer
Different
23
A local variable declared inside a method can not be used in expressions without initializing it first. (TRUE / FALSE).
Correct Answer
TRUE
24
In Java, an array can be declared without initialization without mentioning the size. (True / False)
Correct Answer
A
25
State TRUE or FALSE. An ELSE or ELSE-IF statement in Java can not exist alone without IF statement. (FALSE / TRUE).
Correct Answer
TRUE