• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

toString()

 
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
which are the classes to override the toString() defined in Object class? I know String, StringBuffer and Wrapper classes. Other than that?
 
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So where are all these questions coming from? Your take home Java final?
 
Thiru Thangavelu
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This questions all from Jxam. I think this is the old version which includes lot of questions from Applet.
I don't understand your phrase "Your take home Java final?"
 
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ignore this. I have deleted my post.
 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thiru,
I believe that was an insult. I know I'd get pissed if he told me that.
Seriously, though, it's much easier (and faster) for you to find out answers by yourself than just posting on this forum. For one thing, you could try poking through the API Specs, the answer's right there. You could also use the forum's search function to look for similar posts.
I'm not discouraging you, though, from posting in this forum. Heck, I wish I could post more than my paltry few. But my guess is the regulars here are pretty tired of seeing the same posts over and over again. Then again, I wouldn't know, I'm new around here.
 
Thiru Thangavelu
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul Villangca,
I really don't understand what Paul was mentioning about the last phrase "Your take home Java final?". Can anyone make it clear?
 
Paul Villangca
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, I'd leave it at that, but since you asked...
IMO, he was asking if the question was indeed from a 'take home java final' that you were supposed to finish, and just posted here to fish for answers. Basically, it means find the answers yourself before posting questions.
 
Thiru Thangavelu
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Paul Villangca,
I don't know what he is thinking about members. He just thinks that by coming here there is no other source for java. But he doesn't realize that when he studied first time someone might have helped him to become Sheriff or whatever they call it as. If he doesn't want to answer that he can just leave it. Others can reply or no reply. I don't bother. They don't have to interfere members privacy. I know for sure that, Corey McGlone and Maha Anna have lot of patience in answering and they never thinks/treats silly. Thanks for them and they really deserve their post. Anyway, if there is no members support, there is no Javaranch.
I am really hurt by his answer. Thanks for nice treatment here. Other members what do u think about this?
[ June 16, 2002: Message edited by: Thiru Thangavelu ]
 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think u are right. Something that is simple or silly for someone might be tough for soemone else. So noone should be treated like this. And if they want they can wish not to answer no one is forcing them anyway.
Abt goin thro the sources i would like to add that sometimes u just dont seem to get to the right source or also there these topics are so vast that u might overlook some deatils.
This forum is to help each other and so every member should be doin that whatever be the nature of the question.
Cheer up
 
Thiru Thangavelu
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Deepali, I am happy atleast there is a person like you to indicate their mistake eventhough no sheriff or bartender wishes to take this issue to answer. Probably they can't or they don't want.
 
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Deepali Pate:
This forum is to help each other and so every member should be doin that whatever be the nature of the question.


That is indeed the purpose of this forum. Of course, no one is really helping anyone if one person posts a homework question and someone answers it for them. In such a case, the poster hasn't learned a thing.
Perhaps the original question didn't come from a homework assignment. Every now and then, though, someone does post homework in hopes that someone else will do it for them. There is a reason you do homework - to learn. Having someone else do it for you doesn't help you learn a thing. Many of us frequent this forum (Thomas included, I'm sure) because we like to teach others about Java. Nothing irks me more than someone looking for a free handout.
I really don't like questions that are simply copied and pasted from a mock exam in hopes that someone will give you the answer. I'd like to see the question along with your answer and your reasoning. There are a couple reasons I like this.
1. It shows me that you've at least put some thought into this before posting here.
2. I can look for flaws in your logic. If I can find one, I guess I've just solved your problem. If I have to guess at what you're mistaken about, I might not touch on what the real problem is and you won't get anything out of my answer.
I don't mean to imply anything about Thiru's original question. I just want to let you know where Thomas is coming from (as far as I know). Sometimes, if I'm not sure if someone has thought at all about a question, I might presume it is a homework question or point them to some other resource, like the API or the JLS. My intention isn't to shrug you off, it's to either make you think more about the question, or teach you to find answers on your own. (Even that is something that takes time to learn.)
However, to get back to the original question, which was asked so long ago - check out the API Spec. If you wonder if a class overrides the toString() method, just look at the details for that class to see. From that, I see that Number does, while NumberFormat doesn't.
Corey
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with most of what Corey said.
I can see a point in Thiru's question:
Every SCJP-to-be should know whether certain classes override toString or not.
Wrappers do.
String does.
StringBuffer does.
Maps and Collections do.
Arrays don't.
Date does.
Any other remarkable class?
 
I found some pretty shells, some sea glass and this lovely tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic