1public class Hello
2{
3 public static void main(String[] args)
4 {
5 /*Tip System.out.println(); shortcut Type 'sysout'and press Tab */
6 System.out.println("Hello world!");
7 }
8}
1class Simple{
2 public static void main(String args[]){
3 System.out.println("Hello Java");
4 }
5}
1// Your Package Name
2package com.company;
3
4public class Main {
5
6 public static void main(String[] args) {
7 // write your code here
8 String Hi = "Hello World";
9 String congrats = "This is your first Java Program";
10 System.out.println(Hi);
11
12 boolean hi = true;
13
14 if (hi == true) {
15 System.out.println(congrats);
16 }
17 }
18}
1// This is just a line of code, but publilc class.... is needed!
2 System.out.println("This will be printed");
1public class MyFirstJavaProgram {
2
3 /* This is my first java program.
4 * This will print 'Hello World' as the output
5 */
6
7 public static void main(String []args) {
8 System.out.println("Hello World"); // prints Hello World
9 }
10}