Note 1

Take Note:

Take a note while surfing.





Note With Ink

Give your Note a Colorful Tag.




Easy to Access

Stay on same information and in Sync wherever you are.

Note 2

Take Note:

Organize your information,It may take Shape.





Think With Ink

Differ your Content by Color.




Easy to Access

Easy to pull up your content from anywhere anytime.

Note 3

Take Note:

Don't Let information to miss,Because it take shape





Note With Ink

Simple an Easy Way to take a note.




Easy to Access

Get the same in next visit.

JAVA Programming :: Basic Concepts

Home > JAVA Programming > Basic Concepts > General Questions

21. Which keyword when applied on a method indicates that only one thread should execute the method at a time. Select the one correct answer.

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

Tags:

Virtusa 

22. What is the result of evaluating the expression 14 ^ 23. Select the one correct answer.

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

23. What all gets printed when the following program is compiled and run. Select the one correct answer.

public class test {
public static void main(String args[]) {
inti=0, j=2;
do {
i=++i;
j;
} while(j>0);
System.out.println(i);
}
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

24. What all gets printed when the following gets compiled and run.

public class test {
public static void main(String args[])
{
inti=1, j=1;
try
{ i++;
j;
if(i/j > 1)
i++;
}
catch(ArithmeticException e)
{
System.out.println(0);
}
catch(ArrayIndexOutOfBoundsException e)
{
System.out.println(1);
}
catch(Exception e)
{
System.out.println(2);
}
finally
{
System.out.println(3);
}
System.out.println(4);
}
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

25. What all gets printed when the following gets compiled and run.

public class test {
public static void main(String args[]) {
String s1 = "abc";
String s2 = "abc";
if(s1 == s2)
System.out.println(1);
else
System.out.println(2);
if(s1.equals(s2))
System.out.println(3);
else
System.out.println(4);
}
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

26. What all gets printed when the following gets compiled and run.

public class test {
public static void main(String args[]) {
String s1 = "abc";
String s2 = new String("abc");
if(s1 == s2)
System.out.println(1);
else
System.out.println(2);
if(s1.equals(s2))
System.out.println(3);
else
System.out.println(4);
}
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option E

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

28. What is the range of values that can be specified for an int. Select the one correct answer.

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option B

Explanation:

231 to 231 1

Workspace

Tags:

No Tags on this question yet!

29. What gets printed when the following code is compiled and run. Select the one correct answer.

public class test {
public static void main(String args[]) {
inti = 1;
do
{
i;
} while (i> 2);
System.out.println(i);
}
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

30. At what stage in the following method does the object initially referenced by s becomes available for garbage collection. Select the one correct answer.

void method X() {
String r = new String("abc");
String s = new String("abc");
r = r+1; //1
r = null; //2
s = s + r; //3
} //4

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!