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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -