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 - Strange output order
Summary: Strange output order
Status: RESOLVED DUPLICATE of bug 56341
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 6.x
Hardware: All Windows Vista
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-26 11:08 UTC by t800t8
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***