This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

On String

 
Stephen Joseph
Ranch Hand
Posts: 50
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Errata: Jxam

<code>
1. Object o = new String("abcd");

2. String s = o;

3. System.out.println(s);

4. System.out.println(o);

</code>

As you can see here there will be an compile time error based on incompatible referencing,and this was the probable answer given in Jxam.And this was the only one given by them. But they have missed one that is also correct.
ie.
The program will compile if the first line is altered to
String s = new String("abcd");

this change will make it compile and run

Thanks
Steven
 
Lokesh Mahajan
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Dear
I dont find any thing in it I think you are missing some thing ,your point i am not getting it.
lokesh mahajan
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic