WorksheetsfunWithJava
Total questions: 10
Worksheet time: 5mins
How many primitives data types are in java ?
7
8
6
9
What is NOT a name of a primitive data type in Java?
Int
Float
stand-in
string
Which of the following option makes java portable and secure ?
applet
Bytecode is executed by JVM
Use of exception handling
Dynamic binding between objects
(a) is used to find and fix bugs in the Java programs.
What is the output of following code?
class Equals
{
public static void main(String [] args)
{
int x = 100; double y = 100.1;
boolean b = (x = y);
System.out.println(b);
}
}
true
false
compilation error
exception will be generated
Evaluate the Java expression, (++z + y - y + z + x++)
if the initial values of x=3, y=5, and z=10
34
24
19
23
What is a class?
A class is a section of computer memory that contains objects.
A class is a section of the hard disk reserved for object-oriented programs.
A class is a description of a type of object.
A class is part of an object that contains variables.
If you start a Java application by java Hello World, which is the first method that will be executed?
The method of main()the class HelloWorld.
The method of run()the class HelloWorld.
The method of run()the class HelloWorld.
The method applet().
Which is a valid declarations of a String?
String s1 = null;
String s2 = 'null';
String s3 = (String) 'abc';
String s4 = (String) '\ufeed';
What does the expression float a = 35 / 0 return?
Not a Number
0
Infinity
Run time exception
