Sunday, March 25, 2018

Assignment Operator of Java Programme

/* Example of Assignment Operator */
package webpractrice;
public class WebPractrice
{
    public static void main(String[] args)
    {
        int a = 10, b = 20;
        prln("a = "+ a + "\t\tb = "+b);
        a += 5;
        b *= 5;
        prln("(a+=5) = "+a+ "\t(b*=5) = " +b);
    }
    static void prln(Object anyObject)
    {
        System.out.println(anyObject);
    }
    static void pr(Object anyObject)
    {
        System.out.print(anyObject);
    }
   
}









Share:

0 comments:

Post a Comment

Blogger templates