在Debian 10中执行Java时遇到麻烦

时间:2020-02-21 10:45:30

标签: java

每个人,在Debian 10中执行Java时都会遇到麻烦

package ddd;

class Clothes {
    String color;
    char size;
}

public class Field {
    public static void main(String[] args) {
        Clothes sun = new Clothes();
        Clothes spring = new Clothes();

        sun.color = "red";
        sun.size = 'S';        
        spring.color = "green";
        spring.size = 'M';

        System.out.printf("sun (%s, %c)%n", sun.color, sun.size);
        System.out.printf("spring (%s, %c)%n", spring.color, spring.size);
    }
}

当我执行它时,系统返回一个错误:

error: can't find main(String[]) method in class: ddd.Clothes

有人能弄清楚发生了什么吗?

0 个答案:

没有答案