public class HelloWorld {
public static void main(String []args) {
/* println() function to write Hello, World! */
System.out.println("Hello, World!");
}
}
public class PrintHelloWorld
{
public static void main(String[] args)
{
//This is the print line. Anything in the Quotation Maks will be printed
System.out.println("Hello, World!");
}
}
public class className{
public static void main(String[] args){
System.out.println("Hello World"); // println brings into a new line and print doen't
}
}
// This is a simple Java program.
// FileName : "HelloWorld.java".
class HelloWorld
{
// Your program begins with a call to main().
// Prints "Hello, World" to the terminal window.
public static void main(String args[])
{
System.out.println("Hello, World");
}
}
public class HelloWorld {
public static void main(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");
}
}
import javax.swing.JFrame; //Importing class JFrame
import javax.swing.JLabel; //Importing class JLabel
public class HelloWorld {
public static void main(String[] args) {
JFrame frame = new JFrame(); //Creating frame
frame.setTitle("Hi!"); //Setting title frame
frame.add(new JLabel("Hello, world!"));//Adding text to frame
frame.pack(); //Setting size to smallest
frame.setLocationRelativeTo(null); //Centering frame
frame.setVisible(true); //Showing frame
}
}