harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Linbin Yu (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-4774) [classlib][luni] java.util.Scanner.nextLine() has a problem on newline
Date Wed, 12 Sep 2007 07:47:32 GMT
[classlib][luni] java.util.Scanner.nextLine() has a problem on newline

                 Key: HARMONY-4774
                 URL: https://issues.apache.org/jira/browse/HARMONY-4774
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
         Environment: Win32
            Reporter: Linbin Yu
         Attachments: RI.PNG

Using "java.util.Scanner.nextLine() " to get a input from user,
you must press Enter key twice to end inputing. 

This is a demo:

import java.util.Scanner;

public class test {
	String s1, s2;
	test() {
		Scanner input = new Scanner(System.in);
		s1 = input.nextLine();
		s2 = input.nextLine();
		System.out.println("String1:" + s1);
		System.out.println("String2:" + s2);

	public static void main(String[] args) {
		new test();

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message