Which one is faster in Java and why?
Math.max(a,b)
(a>b)?a:b
(This was asked in an interview.)
If I had asked such a question in an interview, I would have expected the candidate to tell me that the two expressions may not give the same result for all possible types of a and b.