posted 24 years ago
Which of the following statements are true?
1) Adding more classes via import statements will cause a performance overhead, only import classes you actually use.
2) Under no circumstances can a class be defined with the private modifier
3) A inner class may under some circumstances be defined with the protected modifier
4) An interface cannot be instantiated
Answer is 3 and 4
I think we can instantiate interfaces with the help of anonymous classes.
Please clear my doubt
hi Rohan ,
we cant instantiate interface at all,
because it has no constructor .....we can make reference of it.....
..... now what is ur doubt is about Anonymous class ....there
we make an instance of a class which ...imlements
that interface........so that insance is of that class not
of the interface.....
bye dheeraj