Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > BOOK: Beginning Java 2
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
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.
 
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.
 
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...




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





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