NEW
Font size
WorksheetsClass X - Java 1
Total questions: 15
Worksheet time: 7mins
Which of the following option leads to the portability and security of Java?
Bytecode is executed by JVM
The applet makes the Java code secure and portable
Use of exception handling
Dynamic binding between objects
Which of the following is not a Java features?
Dynamic
Architecture Neutral
Use of pointers
Object-oriented
The \u0021 article referred to as a
Unicode escape sequence
Octal escape
Hexadecimal
Line feed
What does the expression float a = 35 / 0 return?
0
Not a Number
Infinity
Run time exception
Evaluate the following Java expression, if x=3, y=5, and z=10;
24
23
20
25
Which of the following for loop declaration is not valid?
for ( int i = 99; i >= 0; i / 9 )
for ( int i = 7; i <= 77; i += 7 )
for ( int i = 20; i >= 2; - -i )
for ( int i = 2; i <= 20; i = 2* i )
Which keyword is used for accessing the features of a package?
package
import
extends
export
Given,
int values[ ] = {1,2,3,4,5,6,7,8,9,10};
for(int i=0;i< Y; ++i)
System.out.println(values[i]);
Find the value of value[i]?
10
11
15
None of the above
What is the range of byte data type in Java?
-128 to 127
-32768 to 32767
-2147483648 to 2147483647
None of the mentioned
What will be the output of the following Java statement?
class output {
public static void main(String args[]) {
double a, b,c;
a = 3.0/0;
b = 0/4.0;
c=0/0.0;
System.out.println(a); System.out.println(b); System.out.println(c);
} }
Infinity
0.0
NaN
all of the mentioned
What will be the output of the following Java code?
class increment {
public static void main(String args[]) {
int g = 3; System.out.print(++g * 8);
} }
25
24
32
33
Literal can be of which of these data types?
Integer
Float
Boolean
All of the above
What will be the output of the following Java program?
class variable_scope {
public static void main(String args[]) {
int x; x = 5;
{
int y = 6;
System.out.print(x + " " + y);
}
System.out.println(x + " " + y);
} }
5 6 5 6
5 6 5
Runtime error
Compilation/Syntax error
If an expression contains double, int, float, long, then the whole expression will be promoted into which of these data types?
Long
Int
Double
Float
What will be the output of the following Java code?
class char_increment {
public static void main(String args[]) {
char c1 = 'D'; char c2 = 84;
c2++;
c1++;
System.out.println(c1 + " " + c2); } }
E U
U V
V E
U F
