You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1.3 KiB

HelloWorld

Setup

Install the JDK of Java 17 here

Create dedicated folder to create your files for this exercise.

If you want to test your code, you need to compile your code :

javac *.java -d build

Then run the following command :

java -cp build ExerciseRunner

to get the output of your function in your console.

To edit your code, you can use any IDE or text editor, though IDEA IntelliJ or JetBrains are specially dedicated and recommended.

On Gitea, create a repository named ((ROOT)), and push all Java files into a folder with a name matching the respective exercise.

Instructions

Create a file HelloWorld.java.

Write a function helloworld that return the string 'Hello World !'.

Expected Functions

public class HelloWorld {
    public static String helloWorld() {
        // your code here
    }
}

Usage

Here is a possible ExerciseRunner.java to test your function :

public class ExerciseRunner {
    public static void main(String[] args) {
        System.out.println(HelloWorld.helloWorld());
    }
}

and its output :

$ javac *.java -d build
$ java -cp build ExerciseRunner
Hello World !
$