+ 1
I am a java beginner Output not coming y frnds
//Methods with arguments class A { int x; void add(int y) { this.x=y; System.out.println(" X : "+x); } } class Demo2 { public static void main(String aa[]) { A.o1=new A(); o1.add(75); } }
5 odpowiedzi
+ 3
this is the correct code . read it and understand it.
//Methods with arguments
class A
{
    int x;
       int add(int y)
    {
        this.x=y;
        System.out.println("X:"+x);
        return y;
    }
}
class Demo2
{
    public static void main(String arg[])
    {
        A o1=new A();
   o1.add(75);
    }
}
+ 1
A o1 = new A();
Remove the "." between A and o1.
+ 1
U can use System.out.print()    To input too
0
thank u g
0
help me to learn Java max



