+ 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); } }

4th Dec 2016, 5:08 PM
Kansi Ram
Kansi Ram - avatar
5 Respostas
+ 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); } }
5th Dec 2016, 7:10 AM
Ntirpang Louis
Ntirpang Louis - avatar
+ 1
A o1 = new A(); Remove the "." between A and o1.
4th Dec 2016, 5:27 PM
Max_N
Max_N - avatar
+ 1
U can use System.out.print() To input too
5th Dec 2016, 5:17 AM
Vergil
Vergil - avatar
0
thank u g
4th Dec 2016, 5:31 PM
Kansi Ram
Kansi Ram - avatar
0
help me to learn Java max
4th Dec 2016, 5:36 PM
Kansi Ram
Kansi Ram - avatar