Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

Wednesday, March 23, 2016

Java If-Else - Hacker Rank Solution

Using "if-else" you can perform decision making in Java. See the flowchart below (taken from wikipedia):

Saturday, February 6, 2016

Java Stdin and Stdout 1 - Hacker Rank Solution

In most of the HackerRank challenges, you need to read input from stdin (standard input) and write your output in stdout (standard output).
One way to take input from stdin is to use the Scanner class and read in from System.in.
You can write your output to stdout by simply using the System.out.println(String) function.

Welcome to Java! - Hacker Rank Solution

Welcome to the world of Java! Just print "Hello World." and "Hello Java." in two separate lines to complete this challenge.
The code stub in the editor already creates the main function and solution class. All you have to do is copy and paste the following lines inside the main function.
Powered by Blogger.