Is this correct?

Is this correct?
public static Int positiveInts (Int[] n)
{
int noOfPositive = 0;
for(int i = 0; i < n.length; i++){
if( n[i].lessThan(0)) break; else (noOfPositive++)}
return noOfPositive;
}
public static Int positiveInts (Int[] n)
{
int noOfPositive = 0;
for(int i = 0; i < n.length; i++){
if( n[i].lessThan(0)) break; else (noOfPositive++)}
return noOfPositive;
}
5 Replies
JavaBot
JavaBot2y ago
This post has been reserved for your question.
Hey @dghf! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
dghf
dghfOP2y ago
For context
Kyo-chan
Kyo-chan2y ago
If you mean in Java, then no Ah my bad, I misread Well in Java, still not, because lessThan() takes an Int and you gave it 0, which isn't an Int Rather than asking whether it is correct though, you could simply try it
JavaBot
JavaBot2y ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one.

Did you find this page helpful?