Section 2.1  Types and Variables

Every value has a type

Examples:

  String greeting = "Hello, World!";

  PrintStream printer = System.out;

  int luckyNumber = 13;

 

Identifier: name of a variable, method, or class

Rules for identifiers in Java:
Can be made up of letters, digits, and the underscore (_) character
Cannot start with a digit
Cannot use other symbols such as ? or %
Spaces are not permitted inside identifiers
You cannot use reserved words
They are case sensitive