Java Package Naming Convention



In this post, we will discuss the Java package naming conventions with examples.

Read complete Java naming conventions at https://www.javaguides.net/2018/08/java-standard-naming-conventions.html.

Packages naming conventions

A package should be named in lowercase characters. There should be only one English word after each dot.
The prefix of a unique package name is always written in all-lowercase ASCII letters and should be one of the top-level domain names, like com, edu, gov, mil, net, org.
Example:
package org.springframework.core.convert;
package org.hibernate.criterion;
package org.springframework.boot.actuate.audit;
package org.apache.tools.ant.dispatch;
Package naming convention used by Oracle for the Java core packages. The initial package name representing the domain name must be in lower case.
package java.lang;
package java.util;
Few more examples:
package com.javaguides.webapp.controller;
 
package com.company.myapplication.web.controller;
 
package com.google.search.common;
Read complete Java naming conventions at https://www.javaguides.net/2018/08/java-standard-naming-conventions.html.

Comments