wood burning stoves
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes problem with clone....... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "problem with clone......." Watch "problem with clone......." New topic

problem with clone.......

sonir shah
Ranch Hand

Joined: Nov 01, 2001
Posts: 435

Answer : It will print "false true"
Can any one explain me why does it print such an answer??
I agree with the second part of the answer i.e(true), But why is ia==ja said to be false??(Since they both are Integer arrays)
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13027
Oh come on! You already know the answer to that. Think! They are two separate objects! What does == test?
Consider Paul's rocket mass heater.
subject: problem with clone.......
It's not a secret anymore!