class Top
}
System.out.println(“Testing myTop method in Down
t.myTop();
} A) Compile B) C) D) A) for (int
System.out.print( i ) ;
B) C)
System.out.print(args[i]);
D) public
MyTest mt = new MyTest();
} A) Compile B) C) D) class
System.out.println(“Printing myTest in MyTest
System.out.println(“Printing myStat in MyTest
} public
System.out.println(“Printing myTest in Test
System.out.println(“Printing myStat in Test
mt.myTest();
mt.myStat();
} A) Printing B) C) D) class T
System.out.println( “Executing run() method”
myTest();
try {
wait(-1000);
System.out.println( “Executing the myTest() method” )
}
} } public
T t = new T();
Thread th = new Thread ( t );
th.start();
} } A) catch ( B) C) D) A) B) C) D) public
s.append(” how are you”) ;
TestBuffer tb = new TestBuffer();
StringBuffer s = new
StringBuffer s1 = new
tb.myBuf(s, s1);
System.out.print(s);
} A) Prints B) C) D) public
increment[1]++;
mt.myTest(myArray);
System.out.println(myArray[1]);
} A) Compile B) C) D) A) B) C) D) E) F) boolean b = if (
}
} A) x = b ? B) x C) b D) b A) int a B) C) D) class
} public
final Vehicle v = new Vehicle ( ” Hello”
v = new Vehicle ( ” How are
v.str = “How is going”;
} A) Compiler B) B) C) A) Java B) C) D) E) int a = int a b = A) a = 1, b B) a C) a D) a public
int a = int int a =
} } A) B) C) D) public
for ( int x = 0; x < i; x++ ) {
System.out.println( x ) ;
}
}
myTest(10);
} } A) At class B) C) D) class A
System.out.println(“Class A
} } class B
System.out.println(“Class B
} } public
System.out.println(“Class C
}
A a = new A(); // Line 1
A a1 = new B(); // Line 2
A a2 = new C(); // Line 3
B b = new C(); // Line 4
} } A) A a = B) A C) A D) B String s =
A) s == B) C) s D) A) It is a B) A C) D) A) //
B) import
C) package
D) //
public
int x = 0;
for ( int i = 0; i < 10; i++ ) {
x = new Math( i );
new System.out.println( x );
}
} } A) Prints 0 B) C) D) A) B) C) D) import class A
System.out.println (“Executing class A
throw new IOException();
} } public
System.out.println (“Executing class B
}
try {
A a = new B();
} catch ( Exception e) {
System.out.println( e.getMessage() );
}
} } A) B) C) D) import class A
System.out.println (“Executing class A
}
System.out.println (“Executing class A
throw new IOException();
} } public
System.out.println (“Executing class B
}
try {
A a = new B();
} catch ( Exception e) {
System.out.println( e.getMessage() );
}
} } A) B) C) D) byte Byte =
A) B) C) D) A) B) C)
A) Window, B) C) D) A) Frame’s B) C) D) A) void B) C) D) A) B) C) D) public
System.out.println( “Printing myTest() method”
myTest();
myMethod();
} A) Compile B) C) D) import public
try {
FileReader fileReader = new
BufferedReader bufferedReader = new
String strString;
fileReader.close();
System.out.println ( strString );
}
System.out.println ( ie.getMessage()
} A) This B) C) D) import class
try {
String strString = “Now is the time to take Sun
char buffer[] = new
strString.getChars(0, strString.length(), buffer,
FileWriter f = new
FileWriter f1 = f;
f1.close();
for (int i=0; i < buffer.length; i += 2)
f.write(buffer[i]);
}
f.close();
FileWriter f2 = new
f2.write(buffer);
f2.close();
System.out.println( ie.getMessage());
}
} A) This B) C) D) Note: import class
try {
String strString = “Updating the critical data
char buffer[] = new
strString.getChars(0, strString.length(), buffer,
FileWriter f = new
FileWriter f1 = f;
for (int i=0; i < buffer.length; i += 2)
f1.write(buffer[i]);
}
f1.close();
FileWriter f2 = new
f2.write(buffer);
f2.close();
System.out.println( ie.getMessage());
}
} A) This B) C) D) A) A File B) A C) A D) A A) B) A) B) C) D) A) new Font B) C) D) E) A) public
B) public
C) public
D) public
A) public
B) public
C) public
D) public
class Check
} public
System.out.println(“True”);
}
} A) Object, B) C) D) A) By B) C) D) E) A) You can B) A C) D) try
} A) Compile B) C)
D) import public
Button b = new Button(“Hello”);
TestBorder t = new
t.setSize(150,150);
t.add(b);
} } A) A Frame B) A C) A D) A) public B) C) D) A) B) C) D)
Button bt = A) public B) C) D)
A) B) C) D) A)
B)
C)
D)
public
private String s1 = “I am inner class
public void innerMethod() {
System.out.println(s);
System.out.println(s1);
}
// XXX legal code here
inner.innerMethod();
} A) B) C) D) public
String s1 = “I am inner class
class InnerClass {
public void innerMethod() {
int xyz = 20;
System.out.println(s);
System.out.println(“Integer value is” +
System.out.println(s1);
}
}
} A) By B) C) D) A) Because B) C) D) import
Vector v = new Vector();
return v.addElement( “Adding element to
MyVector mv = new MyVector();
System.out.println(mv.myVector());
} } A) Prints B) C) D) public
public static void main(String args[])
int x = 1;
System.out.println(“The value of x is ” + (~x >> x)
} } A) B) C) D) A) B) C) D) A) B) C) D) A) A B) C) D) A) As a B) C) D) public
throwMethod();
} A) B) C) D) A) Compile
C) for (
System.out.print(args[i]);
A) Compile The B) Printing
A) catch ( B) C) The here for more information from Java A) C) D)
A) Prints
B) Runtime C)
A) int C) E) The B) x = b ?
A) int a B) C)
B) Compiler In B) Contains E) The D) a = 1, b The D) The C) Test() The D) B b =
A) s == B) The A) It is a B) A D) One C) package
D) //
In a // Comments
D) Compile The A) B) In D) Compile In A) In C) Compile
A) B) C) The C)
A) Frame’s D) In A) void C) D) The
int
int
A) C) D) The
The A) Compile In C) At
C) While
D) While
A) A File B) A C) A The
A)
A) B) The
C) new Font D) E) The A) public
If A) public
The
These are D) Object, The E) None of
A) You can C) D) The A) Compile The D) Frame The C) public D) The A) C) D) The A) public D)
To The A) C) D) In A)
B)
C)
D)
The The method The method The round() A) The C) By In C) This is
B) Compile The C)
C) The B) C) The The A) A B) C) The B) As a D)
A) The |