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?
Joined: Dec 10, 2001
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.