Java Reference
In-Depth Information
source package named org.java8recipes.chapter01.recipe1_02 . All re-
cipe solutions of substance throughout this topic are in that example download.
Make sure you have pasted (or typed) the code from Listing 1-1 . Compile and run
the program, and you should see the following output:
run:
DEFAULT MESSAGE
HELLO, WORLD
BUILD SUCCESSFUL (total time: 1 second)
This output will appear in a new pane named “Output” that is opened by NetBeans
at the bottom of the IDE window.
How It Works
You can run almost all the solutions in this chapter using the same general technique
shown in this recipe. We've been painstakingly detailed for that reason, showing the
step-by-step screenshots just this one time.
Packages
The solution example begins by creating a Java package :
package org.java8recipes.chapter01.recipe1_02;
Packages are a way of grouping related classes together into a shared namespace.
The idea is to achieve universal uniqueness by working your way down your organiza-
tion's domain name in reverse order. It is also customary to write package names in all
lowercase.
NetBeans will create a directory structure to mimic your package path. In this case,
NetBeans created the following directory path:
C:\Users\JonathanGennick\Documents\NetBeansProjects\
Java8Recipes\src\org\java8recipes\chapter01\recipe1_02
Following are some things to notice about this path:
Search WWH ::




Custom Search