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

need explanation on wrapper class

 
praveen kumar
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anyone explain me the output of the follwing program:
public class Test{
public static void main(String args[]){
Byte b1=new Byte("1");
if(b1.toString()==b1.toString())
System.out.println("true");
else
System.out.println("false");

Byte b=new Byte("19");
if(b.toString()==b.toString())
System.out.println("true");
else
System.out.println("false");

}
}

The output is:
true
false
 
A Kumar
Ranch Hand
Posts: 980
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic