[英]Can I organize classes into folders after making them and they will still work?
For Example, i just have a bunch of classes sitting out there for my game. 例如,我只有一堆课程坐在那里为我的游戏。 Some are drawable, nondrawable, animated sprites, and more.
有些是可绘制的,不可绘制的,动画精灵等等。
I just want to know if I right-click my package and add a folder.. drop some classes into it, will it disable my program? 我只是想知道我是否右键单击我的包并添加一个文件夹..将一些类放入其中,它会禁用我的程序吗? I know in XNA it worked like that because you had to give the path.
我知道在XNA中它的工作原理是因为你必须给出路径。 I am unsure in android.
我在android中不确定。
Thanks guys and GALS 谢谢你们和GALS
*Edit (included GALS) *编辑(包括GALS)
No, adding folders and new classes will not affect your program (unless you're doing some processing that depends on your class hierarchy structure staying constant, which is not very common). 不,添加文件夹和新类不会影响您的程序(除非您正在进行某些处理,这取决于您的类层次结构保持不变,这不是很常见)。 However , if you move existing classes to different folders, you will also need to change the
package
statement in each source code file that you moved, as well as all references to these classes. 但是 ,如果将现有类移动到不同的文件夹,则还需要更改移动的每个源代码文件中的
package
语句以及对这些类的所有引用。
If you want to reorganize your class files, the refactoring capabilities in Eclipse will help you with this; 如果要重新组织类文件,Eclipse中的重构功能将帮助您完成此任务; you can move a class using the refactoring tools, and Eclipse will update all references automatically.
您可以使用重构工具移动类,Eclipse将自动更新所有引用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.