4.3.6 Define the terms: variable, constant, operator, object


• Variable: a name that represents a value
• Constant: a value that cannot change during runtime
• Operator: numerical operations, String operations, logical (boolean) operations, e.g. operations on primitive data types
• Object: a collection of data and methods, created from a design (class), allowing multiple INSTANCES. An object has a REFERENCE VARIABLE that "points to" the contents of the object



Variable
• Variables are storage location for data in a program.
• They are a way of naming a memory location for later usage (to put a value into/retrieve a value).
• Each variable has a name and a data type that is determined at its creation (and cannot be changed).

 Constant
• A constant is an identifier with an associated value which cannot be altered by the program during normal execute -the value is constant.
• This is contrasted with a variable, which is an identifier with a value that can be changed during normal execution – the value is variable.

 Operator
• A character/set of characters that represents an action
• Types: – Boolean operators (AND, OR, &&, ||) for working out true/false situations – Arithmetic operators (+, -, ++, --, /, %, div, mod) for doing simple mathematical calculations – Assignment operators , which assign a specified value to another value and ( = ) – Relational operators , which compare two values (<, >, >=, <=, ==, !=, .equals() )

Object
• In Object-oriented programming (OOP), an object is an instance of a class.
• Objects are an abstraction: they hold both data (states), and ways to manipulate the data (behaviours).