fork download
  1. import java.util.*
  2.  
  3. fun main(args: Array<String>) {
  4. var a: Byte = 0x12
  5. var b: Byte = 0x34
  6. var c: Short = 0x0000
  7.  
  8. c = (c.toInt() or a.toInt() shl 8).toShort()
  9. c = (c.toInt() or b.toInt() shl 0).toShort()
  10. println("c is 0x" + c.toString(16))
  11. }
Success #stdin #stdout 0.09s 33248KB
stdin
Standard input is empty
stdout
c is 0x1234