Java Tutorial
Java Getting Started
Understand JDK, source files, compilation, bytecode and JVM execution.
Concept
Java source is normally written in .java files. The compiler creates .class bytecode, which is then executed by the Java runtime.
For a public class, the filename conventionally matches the class name. Begin by learning the class and main method structure before adding more abstractions.
Example
public class HelloJava {
public static void main(String[] args) {
System.out.println("Hello, Java");
}
}
Type the example yourself and change at least one value. Small experiments reveal syntax and behavior faster than passive reading.
Practice Tasks
- Create HelloJava.java and run it.
- Print your name and one arithmetic expression.
- Change the class name and observe the filename requirement.
Key Takeaways
- Java has a compile-and-run workflow.
- main is a standard application entry point.
- The JDK provides the tools used for development.