wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

JAVA UNIT 1 PART 3

Total questions: 13

Worksheet time: 7mins

Name
Class
Date
1.
 Which function is used to perform some action when the object is to be <br />destroyed?
a)
finalize()
b)
delete()
c)
main()
d)
none of the mentioned
2.
What would be the behaviour if this() and super() used <br />in a method?
a)
Runtime error
b)
Throws exception
c)
 compile time error
d)
Runs successfully
3.
What is the range of byte data type in Java?
a)
-128 to 127
b)
-32768 to 32767
c)
( - )2147483648 to<br /> 2147483647
d)
none of the mentioned
4.
Which data type value is returned by all transcendental math <br />functions?
a)
int
b)
float
c)
double
d)
long
5.
Which of these coding types is used for data type characters<br /> in Java?
a)
ASCII
b)
ISO-LATIN-1
c)
UNICODE
d)
none of the mentioned
6.
Which of these values can a boolean variable contain?
a)
True & False
b)
0 & 1
c)
Any integer value
d)
true
7.
Which keyword is used by the method to refer to the object<br /> that invoked it?
a)
import
b)
catch
c)
abstract
d)
this
8.
String in Java is a?
a)
class
b)
Objct
c)
Variable
d)
Chracter Array
9.
Which of these method of String class is used to obtain <br />character at specified index?
a)
char( )
b)
Charat( )
c)
charat( )
d)
charAt( )
10.
Which of these keywords is used to refer to member of<br /> base class from a subclass?
a)
upper
b)
super
c)
this
d)
none of the mentioned
11.
Find out the output:<br /> class string_demo <br /><br /> {<br /><br /> public static void main(String args[])<br /><br /> {<br /><br /> String obj = "I" + "like" + "Java"; <br /><br /> System.out.println(obj); <br /><br /> }<br /><br /> }
a)
I
b)
like
c)
Java
d)
IlikeJava
12.
Which of this method is given parameter via command <br />line arguments?
a)
main ( )
b)
recursive ( )
c)
Any method
d)
none of the mentioned
13.
Which of these data types is used to store command line<br /> arguments?
a)
Array
b)
Stack
c)
Sting
d)
Integer