Custom Search

Java: Glossary of Terms

boolean The parameter type - boolean value (true or false)
char The parameter type - character (a single 16 bit charater 'm' '?')
Class

Class is a category name for a group of objects that have similar properties or characteristics.

Class is the name given to a group of objects that have the same fields to define them.

Each object in a class has the same characteristics as other objects in the same class, i.e. a circle has no corners but a rectangle has four so it can not be in the same 'class' as a circle.

Fine detail such as size and colour are not dealt with in class - they are for the individual instances.

Data

This is the name given to bits of information. Data is needed to create the object and to give it certain characteristics.. It can be in numerical or in word form. For example you input data to set the size and colour of the instance of an object.

Data is entered as a parameter for an object

Error Message "Error: cannot resolve symbol" - incorrect typing of parameter (e.g. missing out the double quotes around a text entry)
Field

Fields are the attributes defining an object's state. For example diameter, position, colour etc.

Objects of the same class will have the same fields.

Instance

An instance is an individual object.

You can have multiple instances when you create lots of objects from a particluar class - for example: circle1, circle2 and circle3. Each of the instances has its own state - but its general characteristics are of the same class.

int The parameter type - integer (a whole number - positive or neagtive; max: 2147483648)
Methods

We can communicate with objects by invoking methods on them. It is the name given to the commands and/or set of instructions that can be given to an object to make it do something, i.e. telling an object to move 25 pixels to the right or change colour

It is rather like casting spells - invoking magic!

Method-calling Objects can communicate by calling each other's methods
Objects

A computer model of some part of the real world represented on the screen by the BlueJ program. The screen shows the 'problem domain' - the world related to the problem set by the lecturer.

Objects are items that can be manipulated in Java. They can be changed by invoking methods - getting them, for example, to change colour and/or move.

Parameters

A Parameter is a variable that must be given a specific value during the execution of a method.

For example, in Java coding, this code - moveVertical (Integer distance) - the parameter would be the distance, as the person has to type in the exact amount of pixels they want the object to move by.

Parameters have types - they define what kinds of values you can set the parameter to... for example if the parameter requires a colour then a number would not be understood.

Parameter types: boolean; char; int; string

Result Methods that return information about an object (output) do so via a return or result value.
Signature A signature is the header of a method. It provides information needed to invoke the method.
Source code The source code of a class determines the structure and behaviour of each of the objects in that class. It determines what fields and methods apply to the objects in that class.
State

The state of an object relates to the set of feld values that define that instance of the object (position, size colour etc).

In BlueJ the state can be inspected by slecting the inspect function. A window opens called the object inspector. You can then view the fields and the set parameters for that instance of the object.

String The parameter type - String - this is a parameter that is a section of text. Strings are enclosed with double quotes e.g. "red"
   
What is the relationship between the state of an object and it's methods? The state of the object is it's current attributes, i.e. whether it is black or red, whether it is big or small etc., whereas a method is instructions that are invoked upon the object. At the start the object is at it's 'initial state', but invoking methods changes the state of the object. But that only happens until the program is closed as it then reverts back to it's 'initial state' - making the method only 'temporary'.