|
|
||
| You are here: | ||
|
Students should be able to: Declare identifiers and types with appropriate scope. Distinguish between private and public identifiers . |
The term variable is often used in High Level Language programming. Variables are areas of storage accessible by a unique name (identifier). Identifier is a general term given to names that a programmer defines. Variables have to be of a specific type . This is so that the computer can intepret the 1's and 0's found at a given memory location since they could represent numbers , names or other kinds of data (see also 3.5.1). The specific primitive types used in JETS are:
Other types are used by the Java language but will not appear in examination questions. Java methods can be private, protected or public in scope: private indicates the method can only be accessed (called) from within the Class in which it is defines. protected (not part of JETS but part of Java) indicates the method can be called from the defining Class and any Class which extends (inherits from) that Class - the sub-classes. public indicates that the method is accessible from any Class. Identifiers such as variables which are declared in the Class body are accessible to all methods in the class (whether those methods are public or private). Identifiers declared within a method are private to that method - they can't be accessed outside the method body. Primitive parameters are also local to the method in which they are defined. public class VideoTape
|
This page deals with objective 2.1.1 which is concerned with the syntax of Java programs. Students can also learn by following the topics in the Java core link (above). |
|
|
|||
|
Questions or problems related to this web site should be addressed to Richard Jones who asserts his right to be identified as the author and owner of these materials - unless otherwise indicated. Please feel free to use the material presented here and to create links to it for non-commercial purposes; an acknowledgement of the source is required by the Creative Commons licence. Use of materials from this site is conditional upon your having read the additional terms of use on the about page and the Creative Commons Licence. View privacy policy. This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License. © 2001 - 2007 Richard Jones, PO BOX 246, Cambridge, New Zealand; This page was last modified: July 29, 200823, 2008 |