my dog learned polymorphism*
The moose likes Beginning Java and the fly likes doubt in String Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "doubt in String" Watch "doubt in String" New topic
Author

doubt in String

manas ranjan mandal
Ranch Hand

Joined: Apr 02, 2008
Posts: 97
I want to know that what is the different between new StringBuffer('A') and new StringBuffer("A")?

Thanks in advance
Garrett Rowe
Ranch Hand

Joined: Jan 17, 2006
Posts: 1296
What is the output of this test and why:

Is there a StringBuffer constructor that takes a char as a parameter? If not, then which constructor is being invoked at line 2?
[ July 11, 2008: Message edited by: Garrett Rowe ]

Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37958
    
  22
And please Use A Meaningful Subject Line. This thread has nothing to do with Strings.
 
Don't get me started about those stupid light bulbs.
 
subject: doubt in String
 
Similar Threads
Adding nulls to stringbuffers
byte [ ] to StringBuffer
How many Objects are created ?
a simple question
StringBuffer...