demo.java:15: error: ')' expected System.out.println(q " "+ w); ^ demo.java:15: error: not a statement System.out.println(q " "+ w); ^ demo.java:15: error: ';' expected System.out.println(q " "+ w); ^ 3 errors
class demo { int a,b; demo(int i,int j) { a=i; b=j; } void test(int x,int y) { int q=0,w=0; q=x;w=y; q*=10; w/=2; System.out.println(q " "+ w); } public static void main(String args[]) { demo d = new demo(5,6); System.out.println("Previous value are "+ d.a+" and "+d.b); d.test(5,6); System.out.print(d.a+" "+d.b); } }
5 and 6 50 3 5 and 6
'+'
Quote:System.out.println(q " "+ w);
System.out.println(q + " "+ w);
System.out.println(q " "+ w);
System.out.println(q + " " + w);
d.test(5,6);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)