Sample MCQ
Sample MCQ
Sample MCQ
random() );
a) 2
b) 3.0
c) 4.0
d) Error
a) 1,2,
b) 1,2,3,4,5,
c) 1,2,4,5,
d) 3,6,
9. System.out.print(Math.pow(Math.sqrt(9),3);
a) 9
b) -9.0
c) 27.0
d) Syntax error
15. System.out.println(Math.floor(-0.88));
a) -1.0
b) -0.0
c) 0.0
d) 1.0
16. ........ is a template to create similar objects that share common characteristics
and behaviour.
a) a method
b) a procedure
c) an attribute
d) a class
17. ...... methods are those methods that do not change the original state of an
object.
a) pure
b) impure
c) ambiguous
d) static
18. the statement System.out.print(2+2+" four "+2+2); give the output
a) 4 four 4
b) 22 four 4
c) 4 four 22
d) Syntax error
19. A ......... conversion are performed by the programmer using the cast operator.
a) explicit type
b) implicit type
c) type promotion
d) widening
22. which package provides classes that are fundamental to the design of the Java
programming language such as string and math class
a) java.util
b) java.io
c) java.lang
d) java.basic