Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

difference between String a ="abcd" and String b= new String ("abcd")

 
seema seema
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the difference between
String a ="abcd";
and
String b= new String ("abcd");
 
Marco Ehrentreich
best scout
Bartender
Posts: 1294
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

we've had the same question here just a few days ago.

Most times it's a good idea to search the forum for an existing answer before posting

Marco
 
Anubhav Anand
Ranch Hand
Posts: 341
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
seema seema,
Welcome to JavaRanch!

We're pleased to have you here with us , but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policyand adjust your display name to match it.

Ideally your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okie one more ranch mantra!
ChooseAForumCarefully
This question does not really belong to Threads and Synchronization forum for sure!
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Marco Ehrentreich:
...we've had the same question here just a few days ago...

Tip: Follow Gaurav's link in that thread.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic