1.8 Expression
Performs the mathematical or logical operation Op on the value of the two expressions.
- Expression
! Expression
Performs logical negation on the value of the expression.
Allows access to the current object. Within a class, fields and methods of the current class must be accessed through this.
Expression.Id (Expression ,...)
The first expression must evaluate to an object value. Id names a method of this object to be called by the current expression. The expressions following Id are evaluated from left to right and passed in to the method as its arguments. The number and types of the arguments must match the method’s declaration. These values replace the argument names in the body of the method, and the result of the body is the result of this expression.
The first expression must evaluate to an object value. Id names a field of this object, whose value is retrieved by this expression.
Evaluates to a new instance (object) of the Id class. The class’s constructor will be run with the given values (evaluated from left to right) as its arguments. These values must be the correct number and type as specified by the constructor.
check Expression expect Expression
Compares the resulting values of the two expressions through a deep comparison, including the fields of objects. The resulting value will be a boolean. Neither expression can have type float or double. When test reporting is enabled, results of checks appear in the testing window.
check Expression expect Expression within Expression
Compares the resulting values of the first two expressions through a deep comparison. The third value must be numeric. If the resulting values of the compared expressions are numeric, their values must be within the third value of each other. For example, in check a expect b within c, the absolute value of a-b must be less than or equal to c. If the compared expressions evaluate to objects, any numeric fields will be compared with this formula. The resulting value will be a boolean. When test reporting is enabled, results of checks appear in the testing window.
Id
Number
Character
Values of type char are ASCII characters enclosed by single quotes such as ’a’ is the character a. They can be used as numbers as well as characters.
String
Strings are created through placing text inside of double quotes. For example "I am a string" is a String. A String value is an instance of the class String, which descends from Object, and can also be created with a constructor.
true
false