byte code
Bytecode is program code that has been compiled from source code into low-level code designed for a software interpreter. It may be executed by a virtual machine (such as a JVM) or further compiled into machine code
byte code
Bytecode is program code that has been compiled from source code into low-level code designed for a software interpreter. It may be executed by a virtual machine (such as a JVM) or further compiled into machine code
what is a byte
A byte consists of 8 bits. Bits contain 0 or 1.
//byte example: 10010010
How do bytes represent a value?
It depends on the places where bits are turned on (have a value of 1)
For example, you want to represent number 1 (decimal) in binary
128 64 32 16 8 4 2 1 //Sum up this value if the bit is turned on
0 0 0 0 0 0 0 1
0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 = 1
The one above represents number 1 in decimal.
What is 1 + 1 in binary??
0000 0001
0000 0001 +
--------------
0000 0010
What happend?
We just created 2 in binary! What an amazing world we live in.
128 64 32 16 8 4 2 1
0 0 0 0 0 0 1 0 //we turned on the second bit to create 2
0 + 0 + 0 + 0 + 0 + 0 + 2 + 0 = 2
Starting to make some sense?
Lets add 1 again (2 + 1 in decimal):
0000 0001
0000 0010 +
--------------
0000 0011
Convert to decimal:
128 64 32 16 8 4 2 1
0 0 0 0 0 0 1 1
2 + 1 = 3
//Happy coding
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us