File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Very simple question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Very simple question" Watch "Very simple question" New topic

Very simple question

Vlada Den
Ranch Hand

Joined: Dec 19, 2004
Posts: 32

How can I change this line, so "only tabs would separate the values in toString()", as teacher wrote to me:

public String toString() {
return("UserID: " + userID +
"\t Name: " + name +
"\t TelephoneNo: " + telephoneNo);

Thanks a lot in advance,

Mike Gershman
Ranch Hand

Joined: Mar 13, 2004
Posts: 1272
Do you mean changing "\t Name: " to "\tName: " or "\tName:"?

Mike Gershman
SCJP 1.4, SCWCD in process
I agree. Here's the link:
subject: Very simple question
It's not a secret anymore!