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
Help coderanch get a
new server
by contributing to the
fundraiser
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
Ron McLeod
Paul Clapham
Devaka Cooray
Liutauras Vilda
Sheriffs:
Jeanne Boyarsky
paul wheaton
Henry Wong
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Tim Moores
Carey Brown
Mikalai Zaikin
Bartenders:
Lou Hamers
Piet Souris
Frits Walraven
Forum:
Programmer Certification (OCPJP)
Annonymous inner class
Divya Gehlot
Ranch Hand
Posts: 243
posted 17 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 17 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 17 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)
Consider Paul's
rocket mass heater
.
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...