Which line will the first compilation error occur in?

public class Test {    
    /* 1 */ public final static class A {}
    /* 2 */ static private class B {}
    /* 3 */ abstract static class C {}
    /* 4 */ static final private class D {}
    /* 5 */ final public abstract class E {}
    /* 6 */ static final abstract class F {}
}
Explanation
Class can not be both abstract and final at the same time.
We have such errors in lines 5 and 6. The first compilation error will occur in line 5.

+Elv Yo, sorry for late response! But here is a tricky formulation of the question: you should specify exactly "first compilation error", not all of them. Updated explanation.

2015 Aug 27, 11:49:58 AM

The 6-th line is too abstract and final !

2015 Aug 16, 11:54:55 AM

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
Java quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes