我是 Java 新手,正在开发一个基本程序,该程序查看数组并打印数组中可被 3 整除的数字数量。我在让它正常工作时遇到了一些麻烦。这是我到目前为止的代码。
package arraysearch;
public class Intsearch {
public static void main(String[] args) {
}
public static void multiple_3 (int[] a, int b) {
b=0;
}
{
int[] numarray ={3, 9, 45, 88, 23, 27, 68};
{
if (numarray % 3)==0;
b = b+1;
}
System.out.println("This is the amount of numbers divisible by 3:" +b)
}
}