SCJP Test - 13 - Online Test

Test Difficulty Level: Medium

Syllabus of Test

Questions based on SCJP

Sample Question from this online test:

Question: 1. public class OuterClass {
2. private double d1 1.0;
3. //insert code here
4. }

You need to insert an inner class declaration at line2. Which two inner class declarations are valid? (Choose Two)
A. static class InnerOne {
public double methoda() {return d1;}
}
B. static class InnerOne {
static double methoda() {return d1;}
}
C. private class InnerOne {
public double methoda() {return d1;}
}
D. protected class InnerOne {
static double methoda() {return d1;}
}
E. public abstract class InnerOne {
public abstract double methoda();
}

Option A: A, B

Option B: A, E

Option C: C, E

Option D: B, D

To answer, click the "Start This Test" button below.

Start this Test






Comments

jainendra pathak on 2012-01-18 05:29:19 wrote,

Question 5: Option A is right not option B.it should throws the Exception. without try block how can we use catch.