Java Reference
In-Depth Information
java -cp
".;<path-to-project>\Java8Recipes\build\classes\org\java8recipes\
chapter1\recipe1_02"org.java8recipes.chapter1.recipe1_02.HelloWorld
This execution will search first in the current working directory (the leading dot in
the class path), and then under the specified package directory corresponding to where
NetBeans would place the compiled classes.
Note See Recipe 1-10 for more on configuring your class path.
1-4. Declaring Simple Variables
Problem
You want to create some variables and manipulate data within your program.
Solution
Java implements eight primitive data types. There is also special support for the
String class type. Listing 1-2 shows an example declaration of each. Draw from the
example to declare the variables needed in your own application.
Listing 1-2 . Declarations for Primitive and String Types
package org.java8recipes.chapter01.recipe1_04;
public class DeclarationsExample {
public static void main (String[] args) {
boolean BooleanVal = true; /* Default is false */
char charval = 'G';
/* Unicode UTF-16 */
charval = '\u0490';
/* Ukrainian letter
Ghe(Ґ) */
byte byteval;
/* 8 bits, -127 to 127 */
 
 
Search WWH ::




Custom Search