Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

string

 
shirsa ray chaudhuri
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
'String a= new String ("cat")' is it right??
 
Balasubramani Dharmalingam
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you give us some more details. What is your question ?
 
Phillipe Rodrigues
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes,

it works.
 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Yes it is right, also there is another way for strings

But is that your exact need. Please explain.


Hope this helps
 
Phillipe Rodrigues
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is exact diff between:

String a ="name";


String b = new String("name1");
 
shirsa ray chaudhuri
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the reply
 
Campbell Ritchie
Sheriff
Posts: 48917
58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by neel mehra:
what is exact diff between:

String a ="name";


String b = new String("name1");
That is a question which comes up quite often, and you haven't had an answer to. It was discussed last week. Have a look at this, and if you still don't understand, ask again.
CR
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic