Runtime error : could not find main in java program

Runtime error : could not find main in java program

我正在使用在线编译器 运行 这个简单的代码,但它给出了一个 运行 时间错误,“无法找到或加载 class Main” 没有其他语法错误。请提出解决方案。

import java.io.*;
class weird
{
    void main ()throws IOException
    {
        BufferedReader br=new BufferedReader (new InputStreamReader(System.in));
        int n;
        System.out.println("Enter a number");
        n=Integer.parseInt(br.readLine());
        if (n>=1 && n<=100);
        {
            if(n%2!=0);
            System.out.println("Weird");
            if(n%2==0);
            {
                if(n<=5&&n>=2)
                System.out.println("Not Weird");
                else if(n<=20&&n>=6)
                System.out.println("Weird");
                else if(n>20)
                System.out.println("Not Weird");
            }
        }
    }
}

main 方法的签名应带有 public 访问修饰符和静态引用。

import java.io.*;
class weird {
    public static void main (String []args)throws IOException {
        // all your code goes here.
    }
}