私は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)
}
}