欧拉的项目 #3 输出错误

Euler's Project #3 Output Error

我目前正在尝试欧拉问题的第 3 题,我 运行 遇到以下问题:当编译以下代码时,我得到的只是“1”作为输出,即使 for 循环使它成为 运行 多次。我已将数字降低到 30 以尝试找出问题所在,但我没有找到。看看其他方案,我的方案逻辑完全一样

public class eulerproblem3
{

public static void main(String[]args)
{
   int current = 1;
    for (int test=1;test==30;test++)
          {
        if ((30%test)==0)
        {
            boolean a = testPrime(test);
            if ((a==true)&&(test==current))
            {  
                System.out.println(current);


            }
        }

    }


  }
  private static boolean testPrime(long test1)
    {
        for(long ref=2; test1==ref; ref++)
        {
            if ((test1%ref)==0)
            {   
                return false;
            }
        }
        return true;
    }

}

for 的条件将始终为假。你可能想要像

这样的东西
for (int test = 1; test < 30; test++)