We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Right. I'm not asking to understand assembly. I'm asking for an understanding of how to use Scanner. I've tried and when I run the code, HackerRank says it's wrong.
public class Solution {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in); // use the Scanner class to read from stdin
String inputString = scan.nextLine(); // read a line of input and save it to a variable
scan.close(); // close the scanner
// Your first line of output goes here
System.out.println("Hello, World.");
//Your second line of output goes here
[NOT SURE WHAT TO DO HERE OTHER THAN CREATED ANOTHER System.out.println("info here!");
}
}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 0: Hello, World.
You are viewing a single comment's thread. Return to all comments →
Right. I'm not asking to understand assembly. I'm asking for an understanding of how to use Scanner. I've tried and when I run the code, HackerRank says it's wrong.
Here's the code:
import java.io.; import java.util.; import java.text.; import java.math.; import java.util.regex.*;
public class Solution { public static void main(String[] args) { Scanner scan = new Scanner(System.in); // use the Scanner class to read from stdin String inputString = scan.nextLine(); // read a line of input and save it to a variable scan.close(); // close the scanner
} }