Header Ad

HackerRank Welcome to Java! problem solution

In this HackerRank Welcome to Java! problem in java programming language You must print two lines of output:

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

HackerRank Welcome to Java! solution


HackerRank Welcome to Java! problem solution

public class Solution {

    public static void main(String[] args) {
        /* Enter your code here. Print output to STDOUT. Your class should be named Solution. */
        System.out.println("Hello, World.");
        System.out.println("Hello, Java.");
    }
}



A solution in Java 8 programming

public class Solution {

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


Post a Comment

2 Comments