Select all invalid lines in the following snippet.
val b0: Byte = 2
val s0: Short = 10
val n0: Int = 5
val l0: Long = 14
val f0: Float = 11.4f
val b: Byte = 5
val s: Short = 2 + b0
val n: Int = s0.toByte() + 2
val l: Long = n0 + 4
val f: Float = l0.toFloat() + 1
val d: Double = f0 / 1
Keep in mind that you cannot assign a value of type Float to a variable of type Double and so on. And remember the rules:
- If either operand is of type
Double, the result isDouble. - Otherwise, if either operand is of type
Float, the result isFloat. - Otherwise, if either operand is of type
Long, the result isLong. - Otherwise, the result is
Int.