The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

Java joption

use joption only
enter 5 integers

enter a number: 5
Output: 5
Enter a number: 6
Output: 5 6
Enter A Number: 5
Output: Please Do not Input same Number
Enter a Number: 7
Output: 5 6 7
and so on till 5 numbers are being inputted
here is my current Code

Re: Java joption

Originally Posted by darking123

my question/problem is how will i code inside my method to do the example i provided

We shouldn't do this for you, but rather you really should try to do this on your own first, else you're just cheating yourself out of good experience. Please do so, and if your attempt doesn't work, come on back, show your attempt and ask any specific questions you may have over your code.