Welcome to Java! Hackerrank solution

Welcome to Java!
Welcome to Java!

Welcome to Java! Hackerrank solution

Welcome to the world of Java! In this challenge, we practice printing to stdout.

The code stubs in your editor declare a Solution class and a main method. Complete the main method by copying the two lines of code below and pasting them inside the body of your main method.

System.out.println("Hello, World.");
System.out.println("Hello, Java.");

Input Format

There is no input for this challenge.

Output Format

You must print two lines of output:

  1. Print Hello, World. on the first line.
  2. Print Hello, Java. on the second line.

Sample Output

Hello, World.
Hello, Java.

Code Solution:

//Welcome to Java! Hackerrank solution

public class Solution {

    public static void main(String[] args) {
       
        System.out.println("Hello, World.");
        System.out.println("Hello, Java.");
    }
}

//Welcome to Java! Hackerrank solution

Disclaimer: This problem is originally created and published by HackerRank, we only provide solutions to this problem. Hence, doesn’t guarantee the truthfulness of the problem. This is only for information purposes.

Leave a Comment