i was able to declare a class with abstract modifier and invoke its constructor directly from another class inside the same file using proper convention.........
i am so much confused and i couldn't match it with any of the fundamental rules in java......
can anyone tell me the legal modifiers that can be used for a class within an interface.....
KARTHICK.C , SCJP6-93%
(Born to Win)
KARTHICK.C , SCJP6-93%
(Born to Win)
I.A ob=new I.A();
i get the compiler error that method I.A is abstract and can't be instantiated.......
Nitish Bangera wrote:
I.A ob=new I.A();
i get the compiler error that method I.A is abstract and can't be instantiated.......
You may be knowing that we cannot instantiate a Abstract class be it inner or a top level class. About anonymous classes, we can even have anonymous implementers also which can be used without actually implementing the interface.
HOW STATIC MODIFIER AND ABSTRACT MODIFIER LIVE TOGETHER
KARTHICK.C , SCJP6-93%
(Born to Win)
SCJP 88% | SCWCD 84%
KARTHICK.C , SCJP6-93%
(Born to Win)
Regards
Balraj Kumar
SCJP 5 95%
SCWCD 82%
Preparing for SCBCD
KARTHICK.C , SCJP6-93%
(Born to Win)
Nitish Bangera wrote:Care to share the answer. I think apart interface not having static methods abstract can go with any thing but final for inner classes.
KARTHICK.C , SCJP6-93%
(Born to Win)
Evacuate the building! Here, take this tiny ad with you:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|