Next:
Summary
Up:
All Units
Unit 02
Use of objects and variables
Summary
A simple Java program
Method calls
Difference between the methods
print()
and
println()
Objects and classes in Java
The class
String
Method signature and method header
Parameters and results of a method
Evaluation of a method call
Evaluation of the expression denoting the invocation object for a method
Evaluation of the expressions denoting the parameters of a method
Static methods
Variables
Variables: main properties
Variables and shoe-boxes
Variable declarations
Assignment
Initializing a variable
Object references
Graphical notation for representing variables
Example: program on strings
Example: string concatenation
Example: initials of a name
Use of "
+
" for string concanenation
Invocation of a constructor
Empty string
Accessibility of objects
References to objects
Immutable objects
Mutable objects: the class
StringBuffer
Mutable objects: methods with side-effect
Example: initials of a name using the
StringBuffer
class
Input from the keyboard
Example: initials of a name read from input
Input from a dialog window
Example: initials of a name read using a dialog window
Output to a window
Exercises
Next:
Summary
Up:
All Units