SYSC 2004 Lecture Notes - Lecture 2: Bluej, Javadoc, Code Smell

61 views2 pages

Document Summary

General form:- public class classname { inner part of the class } Inner part consists of field(s) - define the attributes of every instance of the class constructor(s) - initialize the state of each object when it is created method(s) - implement the behaviours/operations of the objects. Primitive field (non - reference): starts with lower case. Fields are defined in a class, not in an object. Each new instance of the class gets its own copy of all the fields. Values are stored in the object"s copy of the fields. In some object-oriented languages fields are called instance variables. Constant definitions are similar to field definitions, but with two important differences: Keyword final means that the values cannot be changed. Static: not tied to any specific instance; one copy for entire class, no multiples (saves memory!) Initializes a newly created object to a known state and initializes the fields.

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

Related Questions