Back

The program is correct working in eclipse but in codekata its throwing errors

Created 1 year ago
59 Views
2 Comments
GowthamGGlxyO
@GowthamGGlxyO
GowthamGGlxyO
@GowthamGGlxyOProfile is locked. Login

import java.util.Scanner;

public class UserInput

{

public static void main (String[] args){

System.out.println("Enter the numbers");

Scanner scanner = new Scanner(System.in);

String inPut = scanner.nextline();

System.out.println(" The entered numbers are "+ inPut);

}

}

this is my code but codekata shows like below

Main.java:3: error: class UserInput is public, should be declared in a file named UserInput.java
public class UserInput
       ^
Main.java:12: error: cannot find symbol
        String inPut = scanner.nextline();
                              ^
  symbol:   method nextline()
  location: variable scanner of type Scanner
2 errors


Comments (2)
Please login to comment.