Question 51.
Read the code below carefully.
if( "String".endsWith(""))The code produces
Sytem.out.println("True");
else
System.out.println("False");
Question 52.
Read the code below carefully.
if( "String".startsWith(""))The code produces
Sytem.out.println("True");
else
System.out.println("False");
Question 53.
Read the code below carefully.
public class TestClassIs the line marked "lots of code" ever reached?
{
public static void main(String Args[])
{
StringBuffer sb1 = new StringBuffer("String");
StringBuffer sb2 = new StringBuffer("String");
if(sb1.equals(sb2))
{
//lots of code
}
}
}
Question 54.
Read the code below carefully.
public class NiceThreads implements Runnable
{
public void run()
{
while(true)
{
}
}
public static void main(String args[])
{
NiceThreads nt1 = new NiceThreads();
NiceThreads nt2 = new NiceThreads();
NiceThreads nt3 = new NiceThreads();nt1.run();
nt2.run();
nt3.run();
}
}
Question 55.
When does the JVM exit?
Question 56.
Read the following code, which is a part of a synchronized
method of a monitor.
public synchronized void someMethod()
{
//lots of codetry
{
Thread.sleep(500);
}
catch(InterruptedException e)
{
//do some crap here.
}
//more and more code here
}
Question 57.
The no-argument constructor provided by the
compiler when no constructor is explicitly provided in the code
Question 58.
Which of the following is the direct base class of
java.awt.AWTEvent.
Question 59.
Interface methods can be declared with the following modifiers
Question 60.
Which of the following are true about the class defined inside an interface