Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes No Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply locked New topic
Author

No

Dhananjay Ramakrishnappa
Greenhorn

Joined: Jul 25, 2005
Posts: 5
Therz no difference in terms of effieciency.

In the first case a is compared with null

In the second case null is compared with a.

Its very much similar to if(a==a){}
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
I thing this post belongs in the Performance forum in this thread


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: No
 
Similar Threads
Doubt in K&B SCJP 5: Using Maps
Java NullPointer Exception
Questions about string comparison
Is there a difference in how equals() is used?
Disadvantages of Java