all groups > vj# > march 2004 >
You're in the

vj#

group:

Parameters


Parameters Lee
3/16/2004 6:46:13 PM
vj#:
Re: Parameters Lars-Inge Tønnessen
3/17/2004 4:37:57 AM

You do that by a holder object or an array. Here are both examples.




// Example One
public class holder
{
public int number;

public holder()
{
}
}


/**
* Summary description for Class1.
*/
public class Class1
{

// Example One
public void runme( holder Obj )
{
Obj.number = 25;
}



// Example Two
public void runtwo( int[] numb )
{
numb[0] = 34;
}



public Class1()
{
// Example One
holder one = new holder();
one.number = 1;
System.Console.WriteLine("Out : "+one.number );
this.runme( one );
System.Console.WriteLine("Out : "+one.number );



// Example Two
int[] noTwo = new int[2];
noTwo[0] = 1;
System.Console.WriteLine("Out : "+noTwo[0] );
this.runtwo( noTwo );
System.Console.WriteLine("Out : "+noTwo[0] );
}

/** @attribute System.STAThread() */
public static void main(String[] args)
{
new Class1();
}
}



Lars-Inge Tønnessen
www.larsinge.com

AddThis Social Bookmark Button