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.


hackerrank welcome to java problem solution


Welcome to Java! problem solution | HackerRank

import java.util.*;
import java.lang.*;
import java.io.*;
 
class PrintStatementsJava
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		int x = 3;
		int y = 5;
		System.out.println(x + " and " + y + " is " + (x + y));
	}
}

Second solution

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

}

Third Solution

public class Solution {

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