Your First Java Program
Create your first Java class, main method and console output.
Java Code
Study the example and understand what each part does.
public class Main {
public static void main(String[] args) {
System.out.println("Hello, Vinsoft Lab!");
System.out.println("My first Java program.");
}
}
Java code normally runs using the Java Development Kit on a computer, Android Studio or another Java development environment. This course page presents the code examples without pretending that the browser is running Java directly.
Expected Output / Result
Hello, Vinsoft Lab! My first Java program.
Finished this lesson?
Mark it complete to update your course progress.