Can we declare an anonymous class as both extending a class
and implementing an interface?
Answers were Sorted based on User's Feedback
Answer / devnaga
No. An anonymous class can extend a class or implement an
interface, but it cannot be declared to do both
| Is This Answer Correct ? | 26 Yes | 0 No |
Answer / imtiyaz
sorry i will take back my words...
as Devnaga said anonymous class will be created by extending
a class or implementing interface.
you can't to do both at a time simply saying
new SomeClass() extends someOther
we can't write in the same way
new SomeClass() implements someOther
we Can't That's it
| Is This Answer Correct ? | 3 Yes | 2 No |
Answer / devarathnam
Hi... Yes we can declare anonymous class either extending a
class or implementing an interface but not both.
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / devnaga
Yes. U r right. U can fin it from
http://dev.fyicenter.com/interview/java_8.html
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / imtiyaz
upto my knowledge anonymous class can not extend or
implement another class if so can anyone give the example
| Is This Answer Correct ? | 4 Yes | 7 No |
What is the inheritance?
What does serializing data mean?
What is module in project?
Program to find greatest prime number in n numbers?
Why do we need hashset in java?
Explain about complier design(phases)
0 Answers Aditi Placement Service,
Does substring start with 0?
What is an 8 bit word?
How to find the size of an array a)array.length() b)array.length c)array.size() d)array.size
byte a=5; byte b=5; byte c=a+b; System.out.println(c); whats the o/p?
Why java is secure? Explain.
What is use of valueof () in java?