Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > BOOK: Beginning Java 2
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning Java 2
This is the forum to discuss the Wrox book Beginning Java 2, SDK 1.4 Edition by Ivor Horton; ISBN: 9780764543654
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Java 2 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 21st, 2004, 08:54 AM
Registered User
 
Join Date: Dec 2004
Location: Carbost, Isle of Skye, United Kingdom.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Finding Nested Classes hard to grasp

Dear Friends,
I'm going through Mr Hortons book Version 1.4SDK and I can't fully grasp what he's trying to teach when it comes to nested classes in pages 221-229, using the MagicHat class to illustrate the principle. I keep reading over it and I'm almost understanding it. Has anyone got a summary of the can dos and the cannot does of nested classes. Apart from this a specific question is:- Is a non-static nested class to be treated like/or similar to a method that has access to all the variables and methods of the class that it is nested in? If anyone can be bothered to look Mr Horton writes on page 228, "The Rabbit objects that are created in the MagicHat constructor are now associated with the current MagicHat object that is being constructed. The Rabbit() constructor call is actually this.Rabbit()."....Is it this.Rabbit because it is a personal member of each newly formed MagicHat object? And, therefore has a right of access to all the members of the class that called it?
If what I'm saying is true then it should be impossible to ever make the Rabbit class static...but in the other illustation Mr Horton does make it static..I am confused??
I know this question is probably as clear mud but I think what I'm after is any extra help in understanding how nested classes work. Thanks for any answers, Stafford

It's a happy day when men beat their swords into ploughshares but, at the end of the day, only truth will set men free.
  #2 (permalink)  
Old February 3rd, 2005, 07:26 AM
Registered User
 
Join Date: Dec 2004
Location: Carbost, Isle of Skye, United Kingdom.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dear Friends,
Thank you for all your replies...I've now moved on past nested classes and they are much clearer to me now on account of all your help. I'll recommend this book to everyone...especially my fellow mind readers, cheers.





It's a happy day when men beat their swords into ploughshares but, at the end of the day, only truth will set men free.
  #3 (permalink)  
Old February 3rd, 2005, 11:17 AM
Authorized User
 
Join Date: Sep 2003
Location: den Haag, , Netherlands.
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by pilgrim
 Dear Friends,
Thank you for all your replies...I've now moved on past nested classes and they are much clearer to me now on account of all your help. I'll recommend this book to everyone...especially my fellow mind readers, cheers.
Hello there, Pilgrim in progress, I see you are really working your way through the book, just like me a year ago. Then I did some service here on the P2P Java2 forum, answering the occasional question. But I had to move on, alas, so here's my last message.

Java is a great language and fun to learn. I hope one day all the browsers out there will come with a Java virtual machine installed, because the downloading procedure at
http://java.com/en/download/manual.jsp
is too much for the average website visitor.

Knowing the Java syntax and common command names benefited me a lot when I switched over to JavaScript to create fast and easy webpages.
Now it seems some people have outdated JavaScript support and some system managers turn off JavaScript altogether.
Server side scripting with PHP and MySQL is an option. But Java Servlets can manage databases and do all the rest.

There's still a lot to learn!
Final greetings from freezotic

P.S. I do not quite understand the static/non-static behaviour of nested class members myself. I hope Ivor can tell you, though I've seen him here only once...
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding nested elements XSLT 1? Budbertzerofluff XSLT 2 November 15th, 2008 02:45 PM
Hard coded paths pauliehaha Classic ASP Professional 8 February 6th, 2007 06:48 PM
Hard frames problem johnjohn Classic ASP Databases 0 November 30th, 2004 10:38 AM
Windows the hard way astolpho BOOK: Beginning Visual C++ 6 1 March 1st, 2004 05:32 PM
Nested Classes m12x BOOK: Beginning Java 2 2 October 11th, 2003 01:49 PM



All times are GMT -4. The time now is 09:32 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.