Jump to content

Nested classes

- - - - -

  • Please log in to reply
3 replies to this topic

#1
skypower

skypower

    Learning Programmer

  • Members
  • PipPipPip
  • 31 posts
Hello there!

I have been studing Java for 1-2 months. I am now learning nested classes but I am very confused, despite searching online for some help. I would really appreciate some very basic examples and also what a nested class can access from outer or other classes, and what the outer or other classes can access from the nested class.

Any help will do! :c-^_^:

#2
wim DC

wim DC

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,084 posts
  • Programming Language:Java, JavaScript, PL/SQL
  • Learning:Java
Maybe my post here helps: http://forum.codecal...html#post296545
Is the tutorial at Nested Classes (The Java™ Tutorials > Learning the Java Language > Classes and Objects) not clear?

#3
skypower

skypower

    Learning Programmer

  • Members
  • PipPipPip
  • 31 posts
I have already seen this tutorial but didn't find the "which class can access which" architecture :c-smirk:

#4
gregwarner

gregwarner

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 853 posts
  • Location:Arkansas
Nested classes can access the private and protected members of its outer class, and vice versa.
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.

– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users