Java Hello World program
KW.java
Output
kodingwindow@kw:~$ javac KW.java
kodingwindow@kw:~$ java KW Hello, World! kodingwindow@kw:~$
Java program without using main function (only compilation)
KW.java
Output
kodingwindow@kw:~$ javac KW.java
kodingwindow@kw:~$ java KWError: Main method not found in class KW, please define the main method as: public static void main(String[] args) or a JavaFX application class must extend javafx.application.Application kodingwindow@kw:~$
What Next?
Java Hello World program without using a semicolon
Java program to perform the arithmetic operations
Java program to perform the boolean operations
Advertisement