1.
In order for a source file, containing the public class
Test , to successfully compile , which of the following must be true ?
a)
It must be named as Test.class
b)
It must be named as Test.java
c)
It must import java.lang
d)
It must be named as java.Test
2.
Which of the following is a primitive data type ?
a) Integer b) String
c) byte d) Float
3.
What is the value of
111%13 ?
a) 3 b) 5
c) 7 d) 9
4.
What is the result of the expression 5.45
+ “3.2” ?
a) The double value 8.6 b) The String value “8.77”
c) The
long value 8 d) The String value “5.453.2”
a)
It enables you to access instance variables of an object
within the class
b)
It enables you to stores values in instance variables
c)
It is used to invoke methods
d)
It is used to create a new object
a)
existence of two or more classes
b)
method overloading
c)
method overriding
d)
nesting of methods
a)
String
b)
Integer
c)
Boolean
d)
Character
a)
System.out.print(Math.floor(-4.7));
b)
System.out.print(Math.round(-4.7));
c)
System.out.print(Math.ceil(-4.7));
d)
System.out.print(Math.Min(-4.7));
a) 0.0f b) 0.0
c) 0 d) 001
a)
the result is a String object
b)
the result is a double value
c)
the result is a
Double object
d)
an error will occur