java - Why is this an illegal start of expression?and not a statement? -


after using javac in cmd illegal start of expression error , not statement.

string firstname= "james"; string lastname= "oliver"; //display message system.out.println( "welcome "  + "firstname" + "lastname" + + age + "years old";) 

try

system.out.println( "welcome "  + firstname + lastname + "you are" + age + "years old"); 

if want use contents of string variables not enclose them in "" , put ; outside of parenthesis.


Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -