Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 4.0 aka C# 2010 > BOOK: Professional C# 4.0 and .NET 4
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
BOOK: Professional C# 4.0 and .NET 4
This is the forum to discuss the Wrox book Professional C# 4.0 and .NET 4 by Christian Nagel, Bill Evjen, Jay Glynn, Karli Watson, Morgan Skinner; ISBN: 9780470502259
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional C# 4.0 and .NET 4 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 November 1st, 2010, 02:18 AM
Authorized User
Points: 73, Level: 1
Points: 73, Level: 1 Points: 73, Level: 1 Points: 73, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jul 2007
Location: , , .
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 5 - Creating Generic Classes

Question, chapter 5, page 110, Creating Generic Classes, the first code demonstrating non-generic class. In stepping through the code I understand creating the first LinkedListNode, and why First and Last point to the newNode.

In subsequent iterations when the line executes:

Last.Next = newNode;

both First.Next and Last.Next are updated to point to newNode. Then on the next two lines:

Last = newNode;
Last.Prev = previous;

when Last.Prev is updated, First.Prev is not updated. I'm not sure why this happens. Can anybody answer this?

I know during the first iteration that First and Last point to newNode. I'm assuming this has something to due with references. Not sure why Last = newNode, this breaks that reference and Last can be updated without affecting First.

Thanks, Mike

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
.NET 2.0 article: Understanding Generic Classes jminatel .NET Framework 2.0 1 May 4th, 2007 07:30 AM
Excerpt: Understanding Generic Classes jminatel C# 2005 0 April 11th, 2006 08:12 PM
Creating classes!! NitinJoshi General .NET 2 January 24th, 2005 10:44 AM
Creating new objects from existing classes module0000 Beginning VB 6 3 June 17th, 2003 07:13 AM

All times are GMT -4. The time now is 01:25 PM.

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