![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Aug 2005
Location: null
Posts: 40
Rep Power: 0
![]() |
I read in a Lightweight C++ tutorial (what is Lightweight C++ ??) that an inner class in C++ does not have access to the members of its enclosing class. Is that right?
Second I read about inner classes in Java - i understood that they have access to their enclosing class' members (is that always?). And I feel like inner classes in Java are used as an analogy of friend classes in C++. What do you think? |
|
|
|
|
|
#2 |
|
Programming Guru
![]() |
A subclass has access to all the public members of its inherited class.
__________________
|
|
|
|
|
|
#3 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Investigate the meaning of the keywords, "public", "private", and "protected." That said, "Lightweight C++" is what I write
.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#4 | |||
|
Programming Guru
![]() Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,206
Rep Power: 5
![]() |
Quote:
Quote:
Quote:
My understanding of inner classes in Java is that they are similar in nature to such classes in C++. |
|||
|
|
|
|
|
#5 |
|
Programmer
Join Date: Aug 2005
Location: null
Posts: 40
Rep Power: 0
![]() |
thank you for your explanations guys
![]() |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|