CS 1114 Lecture Notes - Lecture 5: Short Circuit

60 views2 pages

Document Summary

Homework: observe lab iv assignment due f, 9/22 at 16:30; program ii due w, 9/27 at 23:59; practice test. Part i mcqs; part ii method writing. Notes: utilizing truth tables (on the test!) can help one further understand the true meaning of a statement. Nested if-then statements may be equivalent to compound conditions. !b() == b() //not demorgan"s law, but good to know. Reserved words include public, class, private, and int. Fields or instance variables store values for an object. Getter methods" or accessor methods allow one to view the attributes of an object stored in a field. return this. price; this. price = newprice; Setter methods" change the attribute as demonstrated below: Method structure : the header provides the method"s signature: public int getprice(){ } public int getprice() public void setprice(int newprice) Field structure : field declaration, the constructor initializes the field, a getter" method provides access to the field, a setter" method allows changes to the field.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents