Thursday, January 2, 2025

Welcome to JAVA @HackerRank

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:


  1. public class Solution {

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

No comments:

Post a Comment

@LeetCode Rewind @2024