which one is more efficient
int x;
1. if(x==null)
2.if(null==x)
state which one either 1 or 2?

Answer Posted / sudhanshu

1. if (x==null)
is the correct answer.

Is This Answer Correct ?    21 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of 'super' keyword inside a constructor?

562


What is the benefit of inner / nested classes ?

527


What does jenkins do?

486


What does null mean in java?

631


What is hashset in java?

530






Given a singly linked list, find the middle of the list in a single traversal without using temporary variable.

612


What two classes are used to read data only?

640


What is a java developer salary?

544


In how many ways we can do exception handling in java?

577


Does variable declaration allocate memory?

587


How do you sort a string in alphabetical order in java?

536


What is string value?

638


Can an interface have a constructor?

515


What are the escape sequences in java?

565


What is an abstract class and what is it’s purpose?

539