473,388 Members | 1,330 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Object Creation in Linked List C#

Hi
I am using C# and my class declaration is like this
namespace UnitTestCaseTool
{
/// <summary>
/// Summary description for RuleParser.
/// </summary>
public class RuleParser
{
public RuleParser()
{
private Object NextItem;
RuleParser RulesProperties;
}

private RuleXMLParser CreateNextNode(RuleXMLParser RulesProperties)
{

step-1: RulesProperties.NextItem = new RuleXMLParser();
step-2: RulesProperties =(RuleXMLParser) RulesProperties.NextItem;
}
}
}

Here my concern is In my first step-1: when I am calling
CreateNextNode function, it is creating new Ruleparser class Object is
it ?
If yes then what I am doing in the Second Step.
i doubt, am i implementing Linked List with Self referential Class ?

Can any body help me.

Mar 6 '07 #1
1 2133
On Mar 6, 8:42 am, sk.rasheedfar...@gmail.com wrote:
Hi
I am using C# and my class declaration is like this
namespace UnitTestCaseTool
{
/// <summary>
/// Summary description for RuleParser.
/// </summary>
public class RuleParser
{
public RuleParser()
{
private Object NextItem;
RuleParser RulesProperties;
}

private RuleXMLParser CreateNextNode(RuleXMLParser RulesProperties)
{

step-1: RulesProperties.NextItem = new RuleXMLParser();
step-2: RulesProperties =(RuleXMLParser) RulesProperties.NextItem;

}
}
}

Here my concern is In my first step-1: when I am calling
CreateNextNode function, it is creating new Ruleparser class Object is
it ?
If yes then what I am doing in the Second Step.
i doubt, am i implementing Linked List with Self referential Class ?

Can any body help me.
Step 2 isn't actually doing anything because you're not passing a
reference to the variable (reference to the reference of the object)
so any reference changes will not have any effect outside the
function.

You'd have to add the ref keyword like this:

private RuleXMLParser CreateNextNode(ref RuleXMLParser
RulesProperties)


Mar 6 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Steven Bethard | last post by:
In the "empty classes as c structs?" thread, we've been talking in some detail about my proposed "generic objects" PEP. Based on a number of suggestions, I'm thinking more and more that instead of...
11
by: C++fan | last post by:
Suppose that I define the following class: class example_class{ public: example_class(); void funtion_1(); void function_2(); protected:
2
by: Ryan Mitchley | last post by:
Hi all I have code for an object factory, heavily based on an article by Jim Hyslop (although I've made minor modifications). The factory was working fine using g++, but since switching to the...
54
by: tshad | last post by:
I have a function: function SalaryDisplay(me) { var salaryMinLabel = document.getElementById("SalaryMin"); salaryMinLabel.value = 200; alert("after setting salaryMinLabel = " +...
6
by: Steve Lambert | last post by:
Hi, I've knocked up a number of small routines to create and manipulate a linked list of any structure. If anyone could take a look at this code and give me their opinion and details of any...
2
by: nacho222 | last post by:
I'm currently in the middle of writing a persistence framework, and I have to make a design decission. The framework will take care of all the saving and restoring objects, and also the...
3
by: Eric Mahurin | last post by:
Is there a standard way to get a descriptor object for an arbitrary object attribute - independent of whether it uses the descriptor/ property protocol or not. I want some kind of...
1
SamKL
by: SamKL | last post by:
Hey, I'm no expert on PHP, and I have somewhat of an understanding of object oriented code. Anyway, getting right to the problem. I'm using PHP4, so base it off of that. Basically I have 2...
7
by: QiongZ | last post by:
Hi, I just recently started studying C++ and basically copied an example in the textbook into VS2008, but it doesn't compile. I tried to modify the code by eliminating all the templates then it...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.