Classları Kullanarak Ref Out İşlemi

using System;

using System.Collections.Generic;

using System.Text;

namspace refout{

class Program {

static void Main(string[] args) {

Console.WriteLine(k2.x + k2.y);

k1.degistir( ref k1, ref k2);//Ref out yöntemiyle adresleri yolluyoruz.
Console.WriteLine(“R “+(k1.x + k2.x));

class hesap {

int x;

public hesap(int a, int b) {

public int y;

x = a;

y = b;

public void degistir(ref hesap k, ref hesap m) {

hesap t;
t = k;

k = m;

hesap k1 = new hesap(10, 20);

hesap k2 =new hesap(40, 50);

m = t;





Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s