简体   繁体   中英

Import in Eclipse

I'm working on my first game and I have a little over 20 classes.

Although it's manageable as it is, I would like to be able to arrange them a bit. It's a "space game", where I have multiple ship types, which each have their own class, which inherits the abstract "ship" class. I would like to put them in a single "Ships" package (and still be able to use them).

So how can this be achieved with Eclipse? I know how to create a package folder in a project, but I don't know how to import them when I need them in a different package of the project.

I have tried searching for an answer but all the examples and answers I've found go way over my simple needs.

it's so easy question. you don't need to import them handy , just when you use your class in other class , for example Ship ship = new Ship(); . if you use auto complete for Ship with ctrl+space eclipse import them automatic, but if you write it and don't use auto complete use ctrl+shift+O to import the class. so easy.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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