which one is more efficient
int x;
1. if(x==null)
2.if(null==x)
state which one either 1 or 2?
Answers were Sorted based on User's Feedback
Answer / person
neither... they wouldn't compile without explicit Integer cast.
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / santosh
if the value is null how can we compare it always (x==null)correct
Is This Answer Correct ? | 2 Yes | 4 No |
How to compare strings in java?
What is the difference between method and constructor ?
Why is java not 100% pure oops?
Can a class be defined inside an interface?
Is nullpointerexception checked or unchecked?
Explain the difference between abstract classes and interfaces in java?
How to do validation of the fields in any project ?
Can we write method inside a method in java?
How can a gui component handle its own events?
How java uses the string and stringbuffer classes?
What is the purpose of the wait(), notify(), and notifyall() methods in java programming?
What do you understand by looping in java? Explain the different types of loops.