A class declaration may include class modifiers.
ClassModifiers:
ClassModifier
ClassModifiers ClassModifier
ClassModifier: one of
Annotation public protected private
abstract static final strictfp
........................
..................
......................
If two or more class modifiers appear in a class declaration, then it is customary,
though not required, that they appear in the order consistent with that shown
above in the production for ClassModifier.
It is compile-time error if an instance initializer of a named class can throw a
checked exception unless that exception or one of its supertypes is explicitly
declared in the throws clause of each constructor of its class and the class has at
least one explicitly declared constructor
An instance initializer declared in a class is executed when an instance of the class
is created (§15.9), as specified in §8.8.7.1.
InstanceInitializer:
Block
It is compile-time error if an instance initializer of a named class can throw a
checked exception unless that exception or one of its supertypes is explicitly
declared in the throws clause of each constructor of its class and the class has at
least one explicitly declared constructor. An instance initializer in an anonymous
class (§15.9.5) can throw any exceptions.
The types of the parameters of the first member method are T1, ..., Tn-1, Tn[].
The types of the parameters of the other method are U1, ..., Uk-1, Uk[].
If the second method is generic then let R1 ... Rp (p ≥ 1) be its type parameters, let Bl be the declared bound of Rl (1 ≤ l ≤ p), let A1 ... Ap be the type arguments inferred (§15.12.2.7) for this invocation under the initial constraints Ti << Ui (1 ≤ i ≤ k-1) and Ti << Uk (k ≤ i ≤ n), and let Si = Ui[R1=A1,...,Rp=Ap] (1 ≤ i ≤ k).
Ti << Uk (k ≤ i ≤ n), and let Si = Ui[R1=A1,...,Rp=Ap] (1 ≤ i ≤ k).
I am eager to know how you did without final,static,protected keywords
what craziest thing you wrote above
saloni jahnwar wrote:
why you have any doubt?? class B and C should extends class A which is going here this condition satisfied and class C has method two you can check.Does this question state specifically that method two should be of class A ??? i think No.
saloni jhanwar wrote:Use private access modifier while you define two() in class A.It is working.cheers