解决报错:The public type Puppy must be defined in its own file

 报错:The public type Puppy must be defined in its own file

解决报错:The public type Puppy must be defined in its own file_第1张图片

原因:class名要与文件名保持一致

解决报错:The public type Puppy must be defined in its own file_第2张图片

新建文件名称与class名一致后运行正常

解决报错:The public type Puppy must be defined in its own file_第3张图片

你可能感兴趣的:(java,eclipse)