Java Fundamentals
Java fundamentals are the basic ideas we need before writing larger programs. They explain how Java tools turn source code into a running application and how a small program is organized.
Why Do We Need This?
Think of learning to cook: knowing the ingredients is not enough if we do not know how to use the stove. In Java, we also need to know how to create a source file, compile it, run it, and read an error.
Main Ideas
| Concept | What it means |
|---|---|
| JDK | Provides development tools, including the Java compiler |
| JVM | Runs Java bytecode |
| Source file | Contains the Java code we write |
| Compilation | Checks source code and produces bytecode |
| main method | The starting method used by the examples in this tutorial |
Simple Working Example
Run this program on its own. All required imports and classes are included.
public class HelloWorld {
public static void main(String[] args) {
int lessonsCompleted = 2;
System.out.println("Lessons completed: " + lessonsCompleted);
}
}Output
Lessons completed: 2The class is named HelloWorld. Its main method creates an integer variable and prints its value. The JDK compiles this code, and a JVM runs the resulting program.
Topics in This Section
Easy Way to Remember
Start by understanding the tools and the path from source code to output. Then learn variables, types, and operators.
See you in next page....??