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 doubt in String Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "doubt in String" Watch "doubt in String" New topic

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

Joined: Oct 13, 2005
Posts: 38788
And please Use A Meaningful Subject Line. This thread has nothing to do with Strings.
I agree. Here's the link:
subject: doubt in String