asked 214k views
1 vote
Given three string variables that have been declared and given values, firstname, middlename, and lastname, write an expression whose value is the values of each these variables joined by a single space. so if firstname, middlename, and lastname, had the values "big", "bill", and "broonzy", the expression's value would be "big bill broonzy". alternatively, if firstname, middlename, and lastname, had the values "jerry", "lee", and "lewis", the expression's value would be "jerry lee lewis".

asked
User Rowlf
by
7.4k points

1 Answer

2 votes
"" + firstName.charAt(0) + middleName.charAt(0) + lastName.charAt(0)
answered
User Kelok Chan
by
8.4k points