ITI 1121 Lecture Notes - Lecture 3: Java Compiler
Document Summary
The area contained by the { } is the body of the class and contains all of the code for the class. The above creating of the myclass is a minimal one and many different keywords can be used for specific goals. Ex/ you can add modifiers like public or private at the beginning. A class can implement more than one interface: the class body, surrounded by {} Field declarations are composed of three components (in order): zero or more modifiers (public, private, the field"s type, the field"s name. The access modifiers let you control what other classes have access to a member field. Public modifier: the field is accessible from all classes. Private modifier the field is only accessible within its own class. It is a good idea to never make public fields but to have public methods that allow the other classes to manipulate the fields within another class.