Q21:float is the type that denotes floating-point numbers that can have fractional parts?
a)True
b)Fales
Q22:instance variables that are numbers are initialized to null default value?
a)True
b)Fales
Q23: public class Test {
public static void main(String[ ] args){
int count = 1;
while(count <= 15){
System.out.println(count % 2 == 1 ? " *** " : "+++++");
count++;
} //end while
} //end main
}
a) *** 15 times
b) +++++ 7 times and *** 8 times
c) *** 7 times and +++++ 8 times
d) +++++ 15 times
Q24:The input to a method is called a ?
a)Parameter
b)args
c)Argument
d)Variable
Q25:Variables declared in the body of a particular method are known as public variables?
a)True
b)Fales
Q26:which key word is used for accessing the features of a package?
a)package
b)export
c)extends
d)import
Q27: class selection statements {
public static void main(String args[ ] ){
int var1 = 5;
int var2 = 6;
if ((var2=1)==var1)
System.out.print( var2 );
else
System.out.print( ++var2 );
}
}
What is the output?
a) 2
b) 1
c) 4
d) 3
Q28:java programming is not statically-typed , means all variables should not first be declared before they can used?
a)True
b)Fales
Q29: *= operator can operate on a boolean variable?
a)True
b)Fales
Q30: int x [ ] = new int[ ]{10,20,30};
Arrays can also be created and initialize as in above statement?
a)True
b)fales
Q31:the main method is the only method that can be defined once in a program?
a)True
b)Fales
Q32:public static float test( int n1, int n2 ) is a right method declaration?
a)True
b)Fales
Q33:what is the initial quantity of the ArrayList array?
int [ ] ArrayList;
ArrayList = new int [ 3 ];
a)null
null
null
b)0
0
0
c) 1
2
3
d) -1
-1
-1
Q34: the do-while loop repeats a set of code at least once before the condition is tested?
a)True
b)Fales
Q35::Evaluate the following java expression , if x=3, y=5,and z=10
++z + y-y + z + x++
a)23
b)24
c)22
d)25
Q36: 2.2 + 1.0 > 4.2?
a)True
b)Fales
Q37: int x=2;
double d = x;
The previous is an example of what?
a)implicit casting
b)both implicit and explicit
c)explicit casting
d)not implicit or explicit
Q38: the switch selection structure must end with the default case ?
a)True
b)Fales
Q39:whats the return type of a method does not return any value ?
a)int
b)char
c)void
d)float