Recommended: Sing it, brah! 5 fabulous songs for developers
JW's Top 5
Hi.
I just started learning JAVA and I am unable to understand why the following program is wrong:
import java.util.Scanner;
public class Test{
public static void main (String args[])
{
int x, y, z;
x = 10;
y = 20;
z=++(x+y);
System.out.println(z);
}
}When I try to compile the program, i get this error:
C:\Mridula_Java\Chapter_4>javac Test.java
Test.java:8: unexpected type
required: variable
found : value
z = ++(x+y);
^
1 error
Can someone help me, please?
Thank You.
- Mridula.