1public class Main {
2
3 public static void main(String[] args) {
4 System.out.println("Hello, World!");
5 }
6
7}
1class main {
2 public static void main(String[] args) {
3 System.out.println("Hello World!");
4 }
5}
6
1// This is just a line of code, but publilc class.... is needed!
2 System.out.println("This will be printed");
1class App {
2 public static void main(String[] args) {
3 // Make sure to save the file with the .java extension and the program
4 // name should mark the class name, in this case, App
5 System.out.println("Hello World");
6 }
7}
1public class Main {
2
3 public static void main(String[] args) {
4 HelloWorld helloworld = new HelloWorld("Hello World");
5 helloworld.Print()
6 }
7 static class HelloWorld{
8 String sentence;
9 HelloWorld(String sentence){
10 this.sentence = sentence;
11 }
12 static void Print(){
13 System.out.println(sentence)
14 }
15}
1class HelloWorld {
2 public static void main(String[] args) {
3 System.out.println("Hello, World!");
4 }
5}
1public class FirstProgram
2{
3 public static void main(String[] args)
4 {
5 System.out.println("Hello World.");
6 }
7}