- Java 9 Programming By Example
- Peter Verhas
- 407字
- 2021-07-02 23:37:29
Managing projects
On the left side of the IDE window, you can see the directory structure of the project. The IDE knows the different types of files and shows them in a way that is meaningful from the programming point of view. For example, it does not display Main.java as a filename. Instead, it displays Main and an icon that signals that Main is a class. It can also be an interface still in a file named Main.java but, in that case, the icon will show that this is an interface. This is again done by the IDE continuously scanning and compiling the code.
The files are structured into subdirectories when we develop a Java code. These subdirectories follow the packaging structure of the code. Many times, in Java, we use compound and long package names, and displaying it as a deep and nested directory structure will not be so easy to handle.
Packages are used to group the source files. The source files for classes that are related in some way should go into one package. We will discuss the notion of packages and how to use them in the next chapter
The IDE is capable of showing the package structure instead of the nested directories for those directories of the project that contain source files.

When you move a class or an interface from one package to another, it happens in a similar way as renaming or other refactoring. All references to the class or interface in the source files get renamed to the new package. If a file contains an import statement referring to the class, the name of the class in the statement is corrected. To move a class, you can open the package and use the good old drag and drop.
Package hierarchy is not the only hierarchy displayed in the IDE. The classes are in packages but, at the same time, there is an inheritance hierarchy. Classes may implement interfaces and can extend other classes. The Java IDEs help us by showing type hierarchies where you can navigate across a graphical interface along the inheritance relations.
There is another hierarchy that IDEs can show to help us with development: method call hierarchy. After analyzing the code, the IDE can show us the graph displaying the relations between the methods: which method calls which other methods. Sometimes, this call graph is also important in showing the dependencies of methods on each other.
- AngularJS Web Application Development Blueprints
- Machine Learning with R Cookbook(Second Edition)
- Arduino開發實戰指南:LabVIEW卷
- JSP開發案例教程
- Visual Basic程序設計實驗指導(第4版)
- Python數據結構與算法(視頻教學版)
- Learning Unity 2D Game Development by Example
- Java系統化項目開發教程
- PHP從入門到精通(第4版)(軟件開發視頻大講堂)
- Android應用案例開發大全(第二版)
- Xcode 6 Essentials
- Oracle Data Guard 11gR2 Administration Beginner's Guide
- UX Design for Mobile
- Node.js實戰:分布式系統中的后端服務開發
- Java EE基礎實用教程