Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Programmer Certification (OCPJP)
Annonymous inner class
Divya Gehlot
Ranch Hand
Posts: 243
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
I want to know can Annonymous Inner Class extend abstract class also if so, then please explain me with the example.
Thanks in advance.
SCJP1.5(81%), SCDJWS(94%), next mission SCEA (but need to wait or that)
Manfred Klug
Ranch Hand
Posts: 377
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi Divya,
it works the same way as with non abstract classes or interfaces.
abstract class Abstract { public abstract void doIt(); } class Test { public static void main (String[] args) { Abstract val = new Abstract() { public void doIt() { System.out.println("Hi!"); } }; // Don't forget the semicolon! val.doIt(); } }
Divya Gehlot
Ranch Hand
Posts: 243
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
Thanks
SCJP1.5(81%), SCDJWS(94%), next mission SCEA (but need to wait or that)
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
How to access an Inner Class' method
two class files for one java file
How to invoke a method in the(flavour one) annonymous innerclass?
interface implementation --- doubt
Can we create a Object of Interface type
More...