• 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

Inner Class

 
Ranch Hand
Posts: 782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ranchers.Is there any good resource or tutorial on inner class.And how Inner Class is important for SCJP.
Bye.
Viki.
------------------
Count the flowers of ur garden,NOT the leafs which falls away!
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Viki,
To get good marks in your test, i would suggest you to master inner classes. Don't be surprised if you get a lot of questions on them. They are very important.
I studied Khalid Mughal's book for Inner Classes...It is an excellent resource.
Also, you might want to visit this link...
http://www.javaranch.com/ubb/Forum24/HTML/012746.html
Good Luck
Shyam
[This message has been edited by Shyamsundar Gururaj (edited November 22, 2001).]
 
Ranch Hand
Posts: 1246
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Make sure you know them all.
Top level nested class. (static)
none-static nested class (none static)
inner class ( static and none)
anonymous class ( staic and none)

And the above link is really good!! Read it! it is a must!
good luck on your exam.
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might want to check Sun's inner class specification at
http://java.sun.com/products/jdk/1.1/docs/guide/innerclasses/spec/innerclasses.doc.html
HIH
------------------
Valentin Crettaz
Sun Certified Programmer for Java 2 Platform
 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are also a couple of articles on Javaworld that I found very helpful, here are the links:
http://www.javaworld.com/javaworld/jw-10-1997/jw-10-indepth.html
http://www.javaworld.com/javaworld/javaqa/2000-03/02-qa-innerclass.html
http://www.javaworld.com/javaworld/javatips/jw-javatip106.html
Best of Luck
Alex
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by FEI NG:
Make sure you know them all.
Top level nested class. (static)
none-static nested class (none static)
inner class ( static and none)
anonymous class ( staic and none)

The summary referred to is useful, but terminology will always be an issue While the passport book was written, we found that terminology regarding inner classes is a complete mess.
The Java Language Specification uses the term "inner class" for all non-static classes defined within another class: An inner class is a nested class that is not explicitly or implicitly declared static. [...] Inner classes include local (�14.3), anonymous (�15.9.5) and non-static member classes (�8.5). It excludes all static nested classes, which makes sense, because they don't have that implicit association with an instance of the outer class.
So far, so good. Unfortunately, elsewhere Sun seriously confuses matters by using the term "inner class" to include static nested classes, and confusion reigns everywhere. The summary quoted above, for instance, uses the term "inner class" for non-static member classes and nothing else - yet another definition!
There's also a slight inaccuracy in the summary - inner classes (of any kind) can define constant members, so the prohibition of static members is not absolute.
- Peter
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic