The Artima Developer Community
Sponsored Link •

Design Forum
code for Full Name

2 replies on 1 page. Most recent reply: Aug 26, 2002 10:15 AM by thomas

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Roob

Posts: 3
Nickname: booboo
Registered: Aug, 2002

code for Full Name Posted: Aug 22, 2002 7:15 AM
Reply to this message Reply
Advertisement
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?


Jody Brown

Posts: 1
Nickname: jbrown
Registered: Aug, 2002

Re: code for Full Name Posted: Aug 26, 2002 9:00 AM
Reply to this message Reply

public String getFullName() {
return firstname + " " + surname;
}

thomas

Posts: 42
Nickname: turbomanic
Registered: Jul, 2002

Re: code for Full Name Posted: Aug 26, 2002 10:15 AM
Reply to this message Reply
> 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?

roob you must start reading your text book if you want to be successful in java. This is simply using the string class which all text books covers.

Flat View: This topic has 2 replies on 1 page
Topic: java telephony Previous Topic   Next Topic Topic: screen saver

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use