This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 98940

Summary: Strange output order
Product: java Reporter: t800t8 <t800t8>
Component: UnsupportedAssignee: issues@java <issues>
Status: RESOLVED DUPLICATE    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: All   
OS: Windows Vista   
Issue Type: DEFECT Exception Reporter:

Description t800t8 2007-03-26 11:08:27 UTC
When I run this code

public class CheckEven {
    
    /**
     * main method
     * @param args
     */
    public static void main(String[] args) {
        // Create a scanner for input
        Scanner scanner = new Scanner(System.in);
        
        // Prompt the user to enter the integer
        System.out.print("Enter an integer:");
        int intValue = scanner.nextInt();
        
        System.out.println("Is " + intValue + " an even number? " + (intValue %
2 == 0));
    }
    
}

the output order in Output pane looks like this

init:
deps-jar:
Deleted 1 out of date files in 0 seconds
compile-single:
run-single:
2
Enter an integer:Is 2 an even number? true
BUILD SUCCESSFUL (total time: 27 seconds)

I need to enter the number first, then Output pane will display "Enter an
integer:". I tried it several times but the order always like this. Seem problem
relates with print(). If I replace print() by println(), this one does not happen.

My system information:
NetBeans IDE Dev (Build 200703221900)
1.6.0_01-ea; Java HotSpot(TM) Client VM 1.6.0_01-ea-b03
Windows Vista version 6.0 running on x86
en_US (nb); Cp1252
Comment 1 Jiri Prox 2007-03-26 16:11:42 UTC
It's problem with ant output buffer. See issue 56341

*** This issue has been marked as a duplicate of 56341 ***