官术网_书友最值得收藏!

Traditional Java code structure

Traditionally, writing a Java application starts with creating one or more source directories. These are special directories that serve two purposes--firstly, they act as root locations of your Java source code and secondly, the contents of these directories are added to the class path. So, the steps to organize source code have typically been:

  1. Create one or more source folders.
  2. In a source folder, create package folders to mirror the package name.
  3. Place the .java files in the right package folders:

Many Java developers use the directory structure src/main/java for the source directory. So, for example, a class Main.java in the package com.acme.app would have the overall path src/main/java/com/acme/app/Main.java:

 

This is how source code in Java has typically been organized by developers for many years now. With Java 9 modules, there's a change in the way we approach structuring and writing code. Let's switch gears and examine what a module in Java 9 looks like.

主站蜘蛛池模板: 中超| 彰化县| 余干县| 德惠市| 武定县| 西平县| 比如县| 涿鹿县| 岳西县| 北票市| 会昌县| 桃源县| 鹤山市| 邵东县| 河源市| 大姚县| 全州县| 开封市| 泸溪县| 安化县| 南郑县| 美姑县| 宁明县| 京山县| 宾阳县| 孟州市| 密山市| 班玛县| 清镇市| 永顺县| 奉贤区| 康马县| 余干县| 元氏县| 通江县| 长宁区| 金塔县| 凌云县| 牡丹江市| 青岛市| 剑阁县|