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
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)
Difference between Inner class and anonymous class
mamidi venkat
Ranch Hand
Posts: 66
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I am bit confused with Inner class and Anonymous class.Can you explain the differnce between the both classes with an example.
shankar reddy
Ranch Hand
Posts: 71
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
inner classes are classes in another class. which can be declared as private.
class Outer
{
class Inner
{
}
}
if you want to create object
Outer.Inner i= new Outer().new Inner().
coming to anonymous classes there are also classes which does contain
reference variable.
say like
method like m1(new java.util.Vetor()) .
Java Lover<br /> <br />Shankar Reddy <br />SCJP1.4 (88%)
shankar reddy
Ranch Hand
Posts: 71
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
inner classes are classes in another class. which can be declared as private.
class Outer
{
class Inner
{
}
}
if you want to create object
Outer.Inner i= new Outer().new Inner().
coming to anonymous classes they are also classes which does not contain
any reference variable.
say like
method like m1(new java.util.Vetor()) .
Java Lover<br /> <br />Shankar Reddy <br />SCJP1.4 (88%)
Jesper de Jong
Java Cowboy
Posts: 16084
88
I like...
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Please do not create multiple topics with the same question.
Continue
here
.
Jesper's Blog
-
Pluralsight Author Page
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Difference between Inner class and anonymous class
Difference between Inner class and anonymous class
Difference between Inner class and anonymous class
Constant Specific class body [ENUM]
inner classes
More...