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
Post a Comment