Campbell Ritchie wrote:Remembering that n % 2 == 1 doesn't reliably find odd numbers.
Mike Simmons wrote:. . . the % operator on ints . .
Campbell Ritchie wrote:Has BigInteger got a mod() method? Yes, it has, though I confused myself by looking for BigDecimal at first. I notice that the BigInteger#mod() method doesn't have the problem you would get with n % 2 == 1
15.8.2 Class Literals
A class literal is an expression consisting of the name of a class, interface, array,
or primitive type followed by a ‘.’ and the token class. The type of a class literal
is Class. It evaluates to the Class object for the named type (or for void) as
defined by the defining class loader of the class of the current instance
Tim Holloway wrote:and since I'm pretty sure that "int.class" isn't valid
salvin francis wrote:The only change I love about it was introducing strings to it in Java 7.
salvin francis wrote: I am still not able to grasp my mind yet over a switch returning a value instead of just comparing.
salvin francis wrote:In my head, a switch was a very elegant way of writing if - else if - else statements.
Campbell Ritchie wrote:And it would mean adding another keyword/reserved word You could do the whole thing with -> alone.