4.3.6 Define the terms: variable, constant, operator, object
A named container for a value stored in memory
Identifiers are the names of variables, methods, classes, packages and interfaces. Unlike literals they are not the things themselves, just ways of referring to them
An instance variable is a variable defined in a class (i.e. a member variable), for which each instantiated object of the class has a separate copy, or instance. An instance variable is declared without the static keyword
A local variable is a variable that's declared within the body of a method
a constant is a value that cannot be altered by the program during normal execution
An operator is a special symbol that performs specific operations on one, two, or more operands, and then return a result.
An operator used to get the integer part of quotient
Is an operator that returns the remainder of a division
An object is an instance of a class
A reference is what is used to describe the pointer to the memory location where the Object resides
/*** Circle class. */
public class Circle { //class declaration
private static final double PI = Math.PI; //constant
double radius; //instance variable
//Constructor
public Circle(double radius){
this. radius = radius;
}
public double getArea(){
double area = 00.0; //local variable
area = PI * Math.pow(this.radius, 2);
}
the rest of the class...
}