Beruflich Dokumente
Kultur Dokumente
Choice a
Polymorphism
Choice b
Inheritance
Choice c
Choice d
Choice b
Choice c
Choice d
Applet
Program
Internet
Choice b
Application
Package
Information
Choice c
Abstract
Programmin
g Interface
Choice d
Application
Programmin
g Interface
Break
statement
Choice b
Continue
statement
Choice c
Pointer type
Choice d
Primitive
data types
Packet statement
Choice b
Import statement
Choice c
Class definitions
Choice d
[6] What is the right method of specifying the main method in Java
Choic
ea
Choic
eb
Choic
ec
Choic
ed
[7]
Choic
ea
Java
Choic
eb
Java is
Choic
ec
is wonderful
Choic
ed
Choice b
Choice c
Choice d
[9] Which of the following is NOT one of the classification of Java variables
Choice a
Instance variables
Choice b
block variables
Choice c
class variables
Choice d
local variables
Choice b
-1
Choice c
Choice d
11
[11] What will be the value of b if a=2 and given the expression b=a++;
Choice a
Choice b
Choice c
Choice d
[12] What is the value of result if the code of statements are executed
int result = 42+45-48-5-15+20*2;
Choice a
59
Choice b
68
Choice c
146
Choice d
134
[13] Which of the following statements do not fall in selection statement category
Choice a
Choice b
Choice c
Choice d
if statement
switch statement
conditional operator statement
for construct statement
zero
Choice b
one
Choice c
two
Choice d
three
[15] Consider the following program code. state the output from it
class ifif
{
public static void main(String args[])
{
int x=3, y=1,z=5;
if(x>y)
{
if (z<=y)
{
System.out.println(y is greater than z);
}
else
{
System.out.println(z is greater than y);
}
System.out.println(x is greater than y);
}
else
{
if(y>z)
{
System.out.println(y is greater than z);
}
}
}
}
Choi
ce a
z is greater than y
x is greater than y
Choi
ce b
y is greater than z
x is greater than y
Choi
ce c
x is greater than y
x is greater than z
Choi
ce d
x is greater than y
z is greater than y
Which of the following looping constructs body, will execute at least once even if
the condition is false.
[16]
Choice a
for
Choice b
do
Choice c
while
Choice d
[17]
Choice a
r is 10
Choice b
r is 0
Choice c
r is 20
Choice d
r is 20 r is 10
Choice b
Choice c
Choice d
Choice b
Choice d
Choice b
Choice c
Choice d
[21] Which of the following String methods is used to give the nth character of the
string
Choice a
substring
Choice b
replace
Choice c
charAt(n)
Choice d
indexOf (n)
[22] Which of the following are similar to the Static final constants
Choice a
Annotations
Choice b
Vectors
Choice c
Enumerated types
Choice d
Object types
Methods
Choice b
Variables
Choice c
classes
Choice d
Both 1 & 2
Choice b
Choice c
Choice d
Choice a
import java.aw+.*;
Choice b
package
Choice c
public
Choice d
class
[26] What does the following import statement actually mean import java.awt.*;
[27]
Choice
a
Choice
b
Choice
c
Import all the classes from the awt package contained in the java
package
Choice
d
Choice
b
Choice
c
Choice
d
[28]
Object
Choice b
Throwable
Choice c
Thread
Choice d
Throw
In Java, which Exception type is caused by general I/O failures such as unable to read
from a file
[29]
Choice a
InvalidAccessException
Choice b
InputOutputException
Choice c
InvalidFileException
Choice d
IOException
[30] Which exception may be thrown if the given code is executed giving 2 integer runtime
arguments
class sample
{
public static void main(String args[])
{
try
{
int a=Integer.parseInt(args[0]);
int b=Integer.parseInt(args[1]);
int c = a + b;
System.out.println("Sum is "+c);
}
catch(ArithmeticException ae)
{ System.out.println("Arithmetic Exception "+ae.getMessage()); }
catch(NumberFormatException ne)
{ System.out.println("Number Format Exception "+ne.getMessage()); }
catch(Exception e)
{ System.out.println("Exception "+e); }
}
}
Choi
ce a
ArithmeticException
Choi
ce b
NumberFormatException
Choi
ce c
Exception
Choi
ce d