Test : Java_4
This test contains 10 questions based on Java.
Each question answered correctly awards you 1 point and each incorrect answer has a penalty of -0.25 points, no points are deducted for unattempted answers.
Each question answered correctly awards you 1 point and each incorrect answer has a penalty of -0.25 points, no points are deducted for unattempted answers.
Select Test Type
You Get +1 for each correct answer and -0.25 for each incorrect answer
Time Left - minutes :seconds
- Class A
- {
- public static void main(String a1[])
- {
- String s1= ?Hello?;
- StringBuffer s2= new StringBuffer(?Hello?);
- s1 = s1 + ?World?;
- s2.append(?World?);
- }
- }
1 & 1 | 2 & 1 |
2 & 2 | 1 & 2 |
What is the output of this program?
class exception_handling { public static void main(String args[]) { try { int a, b; b = 0; a = 5 / b; System.out.print("A"); } catch(ArithmeticException e) { System.out.print("B"); } finally { System.out.print("C"); } } }
A | B |
AC | BC |
Which of these method wakes up the first thread that called wait()?
wake() | notify() |
start() | notifyAll() |
Which of the following statements is correct?
Public method can be accessed by calling object of the public class. | Public method is accessible only to subclasses of its parent class |
Public method can only be called by object of its class. | Public method is accessible to all other classes in the hierarchy |
Which of these keywords is not a part of exception handling?
try | finally |
thrown | catch |
Which of these is used to access member of class before object of that class is created?
public | private |
static | protected |
Which of the following statements are true?
(A) An abstract class may not have any final methods.
(B) A final class may not have any abstract methods.
(C) An inner class may be declared with any accessibility keyword.
(D) Transient variables must be static.
B) & (C) | (A) |
(A) & (C) | (D) |
Which of these keywords are used to define an abstract class?
abst | abstract |
Abstract | abstract class |
Which of the following are the wrapper classes?
(A) Random
(B) Byte
(C) Vector
(D) Integer
(E) Short
(F) Double
(G) String
(B), (D) & (F) | (A), (B), (D), (E) & (F) |
(B), (D), (E) & (F) | (D), (E) & (F) |
Which of the following is correct way of implementing an interface salary by class manager?
class manager extends salary {} | class manager implements salary {} |
class manager imports salary {} | None of the mentioned |
Finish Test
No comments: