Home Download Docs Discord Server

H20 H20

Getting Started

H20 is the same as Java but better literally, no extra twists.

Good to know:

Basic Keywords

Optional Output Flags

Single file mode only:

Your First Program

  1. Place H20.exe in your source folder
  2. Create HelloWorld.h20:
    public class HelloWorld {
        func main() {
            printLn("Hello World!")
        }
    }
  3. Run in your UCRT64 terminal: >
    > ./h20.exe HelloWorld.h20

Project Mode

Note: Output flags are disabled in project mode

  1. Create a folder named src.
  2. Place H20.exe in the root directory
  3. Create main.txt containing your main class name: Main
  4. Add source files to src/:

    src/HelloWorld.h20

    public class HelloWorld {
        func hi() {
            for (mut int i = 1; i < 100; i++) {
                print(i)
            }
        }
    }

    src/Main.h20

    use HelloWorld
    
    public class Main {
        func main() {
            HelloWorld hi = new HelloWorld()
            hi.hi()
        }
    }
  5. Execute via terminal: >
    > ./h20.exe -project main.txt