It is a virtual machine where you can run java.
The following is how you run java.

A compiler converts .java code to .class code which can be interpreted by the machine.
Helpful YouTube Video1 (Korean, 8 min)
Helpful YouTube Video (Korean, 24 min)
Byte code vs Machine code
- Byte code is a non-runnable code generated after compilation of source code and it relies on an interpreter to get executed.
- Machine code is a set of instructions in machine language or in binary format and it is directly executed by CPU.
JVM (compiling): converts .class file to machine language
Java Runtime Environment (JRE): converts .java to .class
Java Development Kit (JDK): does both what JVM and JRE does. It includes all the Java tools needed to run Java programs including debugging functions.

Java is a programming lanugage that requires a main class and method as its basic structure. Also this outer most class's name should match the file name. For the code below the file name should be Main.java.
public class Main {
public static void main (String[] args) {
System.out.println("Hello World!");
}
}
Normally declared variable can change in value. However, when there is the key word 'final' written in front of it, the variable's value cannot be changed.
// this is an example of a non-changeable data which is like a constant
final int nbr = 10
float myFloat1 = 0.123F;
float myFloat2 = 0.123f;
✨ All of the vairables discussed above are primitive type variables ✨
✨They also include boolean and char!✨
Reference types serve as containers for memory addresses or references to objects rather than actually holding the object.
💡 For java double("") or single('') usage is unique! For example, you cannot use double quotes for char.
💡Common naming method is java is using the 🐪 camel case where the all keywords are capitalized except the very first. ex: myNumberBook
Method 1: Use java util library and convert the whole list to a string.
import java.util.Arrays;
public class Main {
public static void main (String[] args) {
int[] a = {1,2,3,4,5};
System.out.println(Arrays.toString(a));
}
}
Method 2: Use a for-loop and index the array.
public class Main {
public static void main (String[] args) {
int[] a = {1,2,3,4,5};
for (int i=0; i<5; i++) {
System.out.print(a[i]);
System.out.print(' ');
}
}
}
Primitive data types such as Int, Double, and Long also exist as a Class. Because Classes have different attributes and methods, we can do so much more with our data when they are in the form of a class object rather that just the data type itself.
Boxing: Converting primitive data types to their corresponding wrapper classes.
Unboxing: Value of a wrapper class is converted back to a primitive type.
public class Main {
public static void main (String[] args) {
int nbr = 10;
Integer nbr1 = nbr; // boxing
System.out.println(nbr1.intValue()); // unboxing
}
}
The address contained in the reference variables are saved in the stack and the actual contents are stored in the heap.
double doubleNbr = 10.1212;
// convert double to int
int intNbr = (int)doubleNbr;
int intNbr = 10;
// convert int to float
float doubleNbr = (float)intNbr;
char c = 'A';
int myInt = c;
System.out.println(myInt); //output is 65
converting int to double
int intNbr = 200;
double doubleNbr = intNbr;
⚠️ When you do division that results in a decimal and store it in int, it drops the decimals ⚠️