ITI 1121 Lecture Notes - Lecture 3: Java Compiler

71 views4 pages

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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents