hi,

can anyone tell me how can i get the OUT parameter value in my calling code.
my code is like following:

Class abc{
public int sum(int a,out int b){
      [B]b[/B] = 10;
      return a+b;
  }
}

how can i use the value of b in my calling environment ?

Thanks and Regards,
Nice Candy.

The class is a keyword and you should have to write in lower letter.

class abc
{
  public int sum(int a,out int b){
       b = 10;
       return a+b;
  }
}

Write following statements to invoke sum method.

abc obj=new abc();
int no1=10,no2;

int result=obj.sum(no1,out no2);
...
...print the values of no2 and result variables
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.