Why does this statement work in Java? -
i accidentally wrote on netbeans:
system.out.println(("apples") system.out.println("oranges")); it showed me no error, compiled , output was:
apples oranges after running started showing me error still compiled , gave same output.
also, system.out.println((grade/=3) + "%") valid statement?
edit: people saying not compiling, here screenshot: http://s1.postimg.org/m1ezmm3vz/untitled.png compiling me :/
the second statement valid:
system.out.println((grade/=3) + "%"); here (grade/=3) calculated first , % appended.
but
system.out.println(("apples") system.out.println("oranges")); is invalid statement. case compiler generates compilation errors :
error: ')' expected error: illegal start of expression error: ';' expected
Comments
Post a Comment