0% found this document useful (0 votes)
780 views

Welcome To Java! - HackerRank

The document introduces a Java challenge that asks the user to print "Hello, World." and "Hello, Java." to the console. It provides code stubs and instructions for the user to paste the print statements into the main method to complete the challenge. The output should match the sample output of printing the two message strings on separate lines.

Uploaded by

Shawn
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
780 views

Welcome To Java! - HackerRank

The document introduces a Java challenge that asks the user to print "Hello, World." and "Hello, Java." to the console. It provides code stubs and instructions for the user to paste the print statements into the main method to complete the challenge. The output should match the sample output of printing the two message strings on separate lines.

Uploaded by

Shawn
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

7

 

12 more points to get your first star!


Welcome to Java!  Rank: 867182 | Points: 13/25
Java


You have successfully solved Welcome to Java! Share    Tweet

You are now 12 points away from the 1st star for your java badge.
Try the next challenge | Try a Random Challenge

Problem Submissions Leaderboard Editorial

RATE THIS CHALLENGE

  
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.

Change Theme Language Java 7

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

 Upload Code as File Test against custom input Run Code Submit Code

Congratulations Earn a certificate in Java

You solved this challenge. Would you like Kudos on your progress! Take the HackerRank
Next Challenge Get Certified
to challenge your friends? Skills Certification test and enrich your profile

Test case 0
Compiler Message

Success

Expected Output Download

1 Hello, World.

2 Hello, Java.

Contest Calendar | Blog | Scoring | Environment | FAQ | About Us | Support | Careers | Terms Of Service | Privacy Policy | Request a Feature

You might also like