简体   繁体   English

如何通过NetBeans中的练习来组织项目?

[英]How can I organize a project with exercises in NetBeans?

I'm doing self-study with a book. 我正在做一本书的自学。 It has a lot of different small exercises. 它有很多不同的小练习。 I don't want to begin a new project everytime, so I want to keep them all in one place organized by chapters. 我不想每次都开始一个新项目,所以我想将它们全部保留在按章组织的地方。

But I'm a complete beginner and having trouble even with that. 但是我是一个完整的初学者,即使那样也有麻烦。 Here's a picture of a mistake that pops up and you can kind of get an idea of what I'm trying to do: 这是突然出现的错误的图片,您可以了解我要执行的操作:

在此处输入图片说明

"1p5" and "1p7" stand for exercises 1.5 and 1.7. “ 1p5”和“ 1p7”分别代表练习1.5和1.7。

If you have an idea on how to organize that sort of thing better, help would be very appreciated. 如果您对如何更好地组织这类事情有想法,将非常感谢您的帮助。

Your problem from the image is that you forgot to add your call to System.out inside a method such as main : 图片中的问题是您忘记了在诸如main的方法中添加对System.out的调用:

class NewClass1p7 {
    public static void main(String... args) {
        System.out.println("...");
    }
}  

Your package organization seems fine and not related to the problem. 您的包裹组织看起来不错,并且与问题无关。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM