java - Need " " when concatenating strings? -


in code below (return statement on last line), need " " between variable firstname , middleinitial? long 1 variable string, doesn't concatenate else string when linked + ?

so example, work?
return firstname + middleinitial + lastname
if not, why not?

 // name object represents name such "john q. public".  public class name {      string firstname;      char middleinitial;      string lastname;       // name in normal order such "john q. public".      public string getnormalorder() {          return firstname + " " + middleinitial + ". " + lastname; } 

the " " necessary if want space between firstname , middleinitial. if don't want space, can omit it.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -