FIT1051 Chapter Notes - Chapter 3: Java Class Library, Operand, String Literal
Week 3
Thursday, 8 March 2018
4:03 PM
Method code
Without data there is very little point to programming. Data values are stored in memory and
addressed by variables or they appear in program code as literals. All data in Java has a data type.
Data values are assigned to variables using assignment statements but only after they have been
properly declared using declaration statements.
Terminology
An expression in Java is the same as an expression in mathematics: a valid combination of variables,
literals, constants, operators and method calls that evaluate to a single value. The operators
combine the terms of the expression to get this single value.
Example - Variables, literals, declaration and assignment statements
Void - means the data does not return a value/has no output data
Parameters - data item values
Syntax templates allow all possible valid syntaxes for a Java statement to be specified without
enumerating each specific possibility. (In many cases it would be an infinite number)
Variable Declaration and Initialisation
find more resources at oneclass.com
find more resources at oneclass.com
Document Summary
Without data there is very little point to programming. Data values are stored in memory and addressed by variables or they appear in program code as literals. All data in java has a data type. Data values are assigned to variables using assignment statements but only after they have been properly declared using declaration statements. An expression in java is the same as an expression in mathematics: a valid combination of variables, literals, constants, operators and method calls that evaluate to a single value. The operators combine the terms of the expression to get this single value. Example - variables, literals, declaration and assignment statements. Void - means the data does not return a value/has no output data. Syntax templates allow all possible valid syntaxes for a java statement to be specified without enumerating each specific possibility. (in many cases it would be an infinite number) Variables do not have to be initialised with a value at their declaration.