Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need Help Initialization...

 
zukof
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everybody
really confused aboout this
What is the differece between these two initializations
String s="Hello!";

AND
String s=new String(Hello!);
are they the same???
Thanx.
 
Val Dra
Ranch Hand
Posts: 439
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.javaranch.com/ubb/Forum33/HTML/001494.html
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
zukof,
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at "JavaRanch Naming Policy" . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please choose a new name which meets the requirements.

[This message has been edited by Cindy Glass (edited February 04, 2001).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic