Hi, please look at my code and let me know why it is not running correctly.
I am getting the error below:
Thanks
package com.codegym.task.task04.task0429;
/*
Positive and negative numbers
*/
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) throws Exception {
Scanner console = new Scanner(System.in);
int a = console.nextInt();
int b = console.nextInt();
int c = console.nextInt();
int negCount = 0;
int posCount = 0;
isPosOrNeg(a);
isPosOrNeg(b);
isPosOrNeg(c);
System.out.println("Number of positive numbers: " + numPositiveNums.posCount);
System.out.println("Number of negatuve numbers: " + numNegativeNums.negCount);
}
public static void isPosOrNeg(int a){
if(a<0){
numNegativeNums(a);
}
else if(a>0){
numPositiveNums(a);
}
}
public static int numNegativeNums(isPosOrNeg){
negCount++;
return negCount;
}
public static int numPositiveNums(isPosOrNeg) {
posCount++;
return posCount;
}
}