steps to create user defined package in java code example Example: compile java code with package in cmd javac –d . demo.java