Navid Taheri created NETBEANS-5365:
--------------------------------------
Summary: Exception in thread "main"
java.util.NoSuchElementException: No line found
Key: NETBEANS-5365
URL: https://issues.apache.org/jira/browse/NETBEANS-5365
Project: NetBeans
Issue Type: Bug
Components: projects - Gradle
Affects Versions: 12.2
Reporter: Navid Taheri
Assignee: Laszlo Kishalmi
This code due to I got this Error:
Exception in thread "main" java.util.NoSuchElementException: No line
foundException in thread "main" java.util.NoSuchElementException: No line found
at java.base/java.util.Scanner.nextLine(Scanner.java:1651)
This is my code:
{code:java}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package sigma;
import java.util.Scanner;
/**
*
* @author sigma
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
System.out.println("What is your name : ");
Scanner scanner = new Scanner(System.in);
String name = scanner.nextLine().trim();
System.out.println("My name is " + name);
}
}
{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists