aspose file tools*
The moose likes Beginning Java and the fly likes NetBeans oddity Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "NetBeans oddity" Watch "NetBeans oddity" New topic
Author

NetBeans oddity

Stephen Davies
Ranch Hand

Joined: Jul 23, 2008
Posts: 352
I am currently working on a simple command line game which requires a random int generated (to pull out a random array entry). I am working within the NetBeans 6.5 IDE and I am having a small issue. Writitng this simple test snippet in NetBeans:



One would expect to get a different number between 0 and 4, wach time main is called? well no, in NetBeans it always returns 0. To be sure I tried compiling and running from the command line and wouldn't you know it, I get random numbers between 0 and 4. So whats going on here, can anyone point me in the right direction? I cant find Much on the web, if it is infact a NetBeans issue or must I set some parameters?

:?


be a well encapsulated person, don't expose your privates, unless you public void getWife()!
Vikas Kapoor
Ranch Hand

Joined: Aug 16, 2007
Posts: 1374
What's the issue?
Stephen Davies
Ranch Hand

Joined: Jul 23, 2008
Posts: 352
Well it must be the late night here, because I realized I was running the wrong file, as the current clip above was not set a the main project file. In the words of Homer J Simpson.

DOH! ops:
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36478
    
  16
What is the exact printout you get from NetBeans?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36478
    
  16
Oh, I see you have sorted the problem :lol:

We have all done that sort of thing.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NetBeans oddity
 
Similar Threads
Help with LineNumberReader
Problems overwriting toString() method.
array question
Assertion doubt
Using percent Modulus to calculate total number of even numbers from user input