publicclassPrintHelloWorld{publicstaticvoidmain(String[] args){//This is the print line. Anything in the Quotation Maks will be printedSystem.out.println("Hello, World!");}}
// This is a simple Java program.// FileName : "HelloWorld.java".classHelloWorld{// Your program begins with a call to main().// Prints "Hello, World" to the terminal window.publicstaticvoidmain(String args[]){System.out.println("Hello, World");}}
publicclassHelloWorld{publicstaticvoidmain(String args[]){// If you use println java will put a newline at the end. System.out.println("HelloWorld");System.out.print("HelloWorld");System.out.println("HelloWorld");}}
importjavax.swing.JFrame;//Importing class JFrameimportjavax.swing.JLabel;//Importing class JLabelpublicclassHelloWorld{publicstaticvoidmain(String[] args){JFrame frame =newJFrame();//Creating frame
frame.setTitle("Hi!");//Setting title frame
frame.add(newJLabel("Hello, world!"));//Adding text to frame
frame.pack();//Setting size to smallest
frame.setLocationRelativeTo(null);//Centering frame
frame.setVisible(true);//Showing frame}}