Expression Language Terminology

The following are some of the common object-oriented programming terms found in the Java programming language and used in the Expression Language.

Language Terminology

Term

Description

BigDecimal

A decimal number that can be arbitrarily large.

BigInteger

An integer that can be arbitrarily large. It is not limited to the 64 bits available in the long data type.

Class

A data type that defines what a specific type of object is. You associate methods with the data type.

Comments

Everything between /* and */ is ignored by the script parser and is used for entering comments. These comment separators can be spread over more than one line. Everything after // on one line is ignored by the script parser and is used for entering comments on one line.

Constructor

Creates a new instance of a class, an object, and initializes all the fields in that instance. A constructor method has the same name as the class.

Floating-Point numbers

Has a decimal point and a fractional part. They can be positive or negative and come in two sizes:

  • float: A four-byte number that can contain values as small as 1.40129846e-45 and as large as 3.40282347e+38

  • double: An eight-byte number that can contain values as small as 4.940656458412446544e-324 and as large as 1.79769313486231570e+308

identifiers

Names of variables, methods, classes, packages, and interfaces. Unlike literals, they are not the objects themselves, just ways of referring to them.

An identifier is an unlimited-length sequence of letters and digits and underscore, the first of which must be a letter or an underscore. An identifier cannot have the same spelling as a keyword, Boolean literal, day of week literal, gender literal or the null literal.


identifier:
  identifierChars but not a Keyword or BooleanLiteral
     or DayOfWeekLiteral or GenderLiteral or NullLiteral
identifierChars:
  Letter
  identifierChars LetterOrDigit
Letter:
   any from A to Z
      any from a to z
      _
    LetterOrDigit:
      Letter
      any from 0 to 9

Examples of identifiers are:


i3	_i	String		MAX_VALUE		isLetterOrDigit

Integers

Whole numbers. They come in four sizes:

  • int: The default type. Takes up to four bytes of memory and can hold numbers between -2,147,483,648 and +2,147,483,647

  • long: Takes up to eight bytes of memory and ranges in size from -9,223,372,036,854,775,808 to +9,223,372,036,854,775,807

  • short: Takes up two bytes of memory and can hold numbers between -32,768 and +32,767

  • byte: The shortest integer of all. Is one byte long and ranges in value from -128 to 127.

Keywords

Reserved words that cannot be used by the programmer for variable or method names. Uses the same keywords that Java uses. For a list of these keywords, see http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.html.

Literal

A value that is written directly into an expression without being stored in a variable first.

Method

A function that all objects in a class can perform. When more than one argument can be passed to a method, the successive arguments are separated by commas. Every method has a return type or else it is called a void method. A void method produces no output, begins with the void keyword and is usually used to notify an object of an event. A method can return only one value.

Object

A specific instance of a class. When you create a new object, you are said to be “instantiating” the class. To create an object, use the keyword new . The new keyword is also called the “construction operator.”

Operator

A symbol that operates on one or more arguments to produce a result.

Package

A group of functionally related classes.

Public

If a field or variable is declared to be public, it can be used by any object.

Remainder or Modulus

The remainder value of a number left over after one number is divided by another. For example, 7 divided by 2 has a remainder or modulus of 1.

Separators

Help define the structure of your expressions.

Separator

Description

(   )

Parentheses. Enclose arguments in method definitions and calling. Adjusts precedence in arithmetic expressions. Surrounds cast types and delimits test expression in flow control statements.

{  }

Curly braces. Define a block of statements.

[   ]

Square brackets. Declare array types and used for referencing array members.

;

Semicolon. Terminates a code statement.

,

Comma. Separates successive identifiers in a variable declaration. Joins statements in the test expression of a for loop.

.

Period. Separates and selects a field or method from an object. Separates package names from class names and subpackages.

Thread

An independent process. A single program can have many different processes executing independently and continuously.

Tokens

The smallest items in the language. They consist of keywords, operators, comments, identifiers, separators, white space, and literals.

Unicode

A two-byte character code set that has characters representing almost all characters in the human alphabets and writing systems around the world, including English, Arabic, and Chinese.

Variable

Stores a value in a computer storage location. That value can be changed by programs acting on it. Variables defined within a class are member variables or fields of that class.

White Space

The single space, the horizontal tab, the form feed, the carriage return, and the linefeed characters. Outside of String literals, white space characters are all treated the same. Many white space characters together are also treated the same, as if they were one. They are used to separate tokens and to enhance code legibility for human reading.