Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

string  RSS feed

 
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: 2856
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: 55338
157
  • 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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!