This piece of code does not compile: ``` val b...
# announcements
e
This piece of code does not compile:
Copy code
val byteVal:Byte = 0
val isZero = byteVal == 0
You have to change it to this to make it compile (and run):
Copy code
val byteVal:Byte = 0
val isZero = byteVal == 0.toByte()
This seems overly complicated to just compare a byte-value with a literal. Do we really have to call a method (
toByte()
) to do this? Is there a modifier (much like
L
for longs and
f
for floats) to make this simpler and less expensive?
i
­čĹŹ 1