User Tools

Site Tools


solution_of_1._create_a_minimal_program

The Java training online

Back to the table of contents

Solution: 1. Create a minimal program

Try to work with the helping elements before looking at the solution…

Helping elements

  • package named training → the source code must be located in a directory named training
  • package named training → the first statement in the class must be package training;
  • class named Training → the source code must be saved in a file named Training.java
  • a main method → Its signature is conventionally: public static void main(String[] args) {…
  • to write in the terminal, use the statement System.out.println (“some text”);
  • compilation in the terminal from the java/ directory, type javac training/Training.java
  • execution from the terminal, from the java/ directory, type java training.Training

A possible solution

A minimal program

Back to the table of contents

solution_of_1._create_a_minimal_program.txt · Last modified: 2021/12/13 09:28 by 127.0.0.1