java - (Noob) Quick help on output statement -


    if (gpa < 2.0)     system.out.println("the student "  +first  +last + " not graduating.");  

this output statement. result

the student bobpaul not graduating.

how add space between +first , +last way output statement looks like

the student bob paul not graduating.

the correct answer is

system.out.println("the student " +first + " " + last + " not graduating.");

it simple. concatenate string " " empty space in between.

system.out.println("the student "  +first + " " + last + " not graduating."); 

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 -