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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

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

android - How to create dynamically Fragment pager adapter -