GlossaryThis page is meant to be a place to look up unfamiliar terms
that may be used throughout the course. If there is a word
that you are confused about, or feel should be here, or could be
explained better, please e-mail
. Any words that are underlined are defined within this
glossary. accessor A method that allows one to access information about the object. For example, a getRadius() method is an accessor, as it allows you to get the radius of a Circle object. actual parameter The parameter passed to a method when it is called (as opposed to the parameter defined within the definition of a method). Compare with formal parameter. block A series of code statements that are enclosed by curly braces. One can have a block of zero statements (so the block just consists of the curly braces). default constructor The constructor that takes in zero parameters. There can only be one default constructor for any given class. If you do not define any constructors for a class, Java will put one (that takes in no parameters) in by default -- hence the name. class The full definition for how to create an object. class variable A variable defined within a class that is defined using the static keyword. There is only one class variable for all the objects created (even if there are zero objects created). In other words, that one variable is shared between all the objects of the class -- hence it's name. Class variables (along with instance variables) ARE initialized to default values. constructor The method called when an object is created. It's job is to help create (or construct) the object. There are two types of constructors: default constructors and specific constructors. declare/declaration To create a variable that can be used in the program. This is different than initialization, which gives the variable a value. Declaration just creates the variable so that it can be used to hold values later on. For example, int x; just declares the variable, while int x = 5; both declares and initializes the variable. default values Instance variables and class variables are automatically given initial values by Java if you don't specify initial values (numerical variables receive 0 or 0.0, boolean variables get false, and references get null). Local variables are not given default values. define In this context, it is a synonym for declare. facilitator A method that is not a constructor, accessor, or mutator (a more better definition to follow) field Synonym for instance variable, although sometimes used for class variable. formal parameter The parameter defined within the definition of a method (as opposed to the value passed to a method when it is called). Compare with actual parameter. identifier The name you use to name something within Java. For example, if you define a variable named foo, then foo is the identifier. initialize When a variable is first given a value after it is declared. For example, int x; just declares the variable, while int x = 5; both declares and initializes the variable. instance variable A variable defined within a class that is NOT defined using the static keyword. Each object created has it's own copy of each instance variable. One example is the radius variable in the Circle class - each Circle has its own radius. Instance variables (along with class variables) ARE initialized to default values. instantiate To create a variable out of a type, or to create a object out of a class. Using an analogy, if you create a cookie from a recipe, you instantiate the recipe, which results in the cookie. The cookie is an instance of the recipe. Likewise, you instantiate a type to get a variable, and you instantiate a class to get an object. iteration To do something repeatedly, as with a for or while loop. keyword A pre-defined word within Java. For example, Java knows the word class means something special (the opening line to defining a class), so you can't define a variable named class. local variable A variable defined within a method, or within a block (such as a for block or an if block) in a method. Local variables are NOT initialized to default values (but class variables and instance variables are). member variable Synonym for instance variable. method A segment of code that performs some function, or implements some behavior. There are four types of methods: constructors, accessors, mutators, and facilitators. Constructors have a different format (and function) than the others. The other three names are based on what the method does. Note that Java calls them methods, but they are called other things in other languages: procedures, functions, subroutines, etc. mutator A method that allows one to modify (i.e. mutate) part of the object. For example, a setRadius() method is a mutator, as it allows you to set the radius of a Circle object. object An instance of a class. overloading When a class/object has more than one method of the same name. The parameter list must be different. overriding When a subclass redefines a method from the parent class - we won't see this until we talk about inheritance (the very end of the course) parameter The value passed into a method between the parenthesis. There are two types of parameters: actual parameters and formal parameters. pointer Synonym for reference (not exactly, but for this course, they can be considered synonyms) primitive type Synonym for type. reference A memory address. When an object is created, Java creates both the object in a memory, and copies the address of that location into the reference. Note that the reference is a variable (it holds the memory address), which points to the object. However, both are commonly referred to as an object. specific constructor A constructor that takes in one or more parameters. Any object can have multiple specific constructors. These are constructors that the user specifies, hence the name. The parameters that are passed to the specific constructor are used to initialize the fields of the object. statement A line or two of code in Java, terminated by a semi-colon. static variable Synonym for class variable. type One of the eight basic types (int, short, byte, long, boolean, float, double, char). Because they do not have any methods or properties (other than their value), they are considered 'primitive'. variable A spot in memory to hold a value. A variable can be a reference or instantiated from a type.
|