class Test
{
    int a,b;
    Test(int x,int y)
    {
        a=x;
        b=y;
    }
   
    void meth(int x,int y)
    {
        a=x*2;
        b=y/2;
        System.out.println("in meth function A :"+a);
        System.out.println("in meth function B :"+b);
       
    }
}

class CallByValue
{
    public static void main(String arg[])
    {
   
        int a,b;
        a=10;
        b=20;
       
        Test t1= new Test(a,b);
        System.out.println("A:"+a);
        System.out.println("B:"+b);
       
        t1.meth(a,b);
       
        System.out.println("A:"+a);
        System.out.println("B:"+b);
       
    }
}

No comments:

Post a Comment

Unleashing B2B Success: Mastering Event and Conversion Tracking with GA4

Tracking events and conversions is vital for B2B businesses using GA4 (Google Analytics 4) to optimize their marketing efforts. Here is a re...