| Author |
code for writing full-name
|
Booba Degouv
Greenhorn
Joined: Aug 20, 2002
Posts: 3
|
|
Hello, i have a class "Person" with the attributes: firstname - a String first name surname - a String surname But i need to know how to write a method for fullname; which returns a string containing firstname and surname separated by a space. Its probably really simple, but i dont know how to? any suggestions?
|
 |
Dirk Schreckmann
Sheriff
Joined: Dec 10, 2001
Posts: 7023
|
|
The method you're supposed to come up with probably involves String concatenation. For a definition of concatenate, take a look at this, this, and this. For example: String a = "a"; String b = "b"; String ab = a + b; String ab would then be "ab". For more information and a better explanation, take a look at Chapter 29 of Bradley Kjell's Introduction to Computer Science using Java.
|
[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
|
 |
 |
|
|
subject: code for writing full-name
|
|
|