I\'d like to print out all prime numbers from an array with method. I can do it with one int but don\'t know how to return certain numbers from array. Thanks for help!
I would suggest you separate this into two methods:
That separates out the two concerns neatly. If you're stuck on exactly how to do this, please give details of which bit you find hard. (I'm assuming this is homework, which is why I haven't just included the code.)