CS 106A Chapter Notes - Chapter 5: Greatest Common Divisor, Top-Down And Bottom-Up Design, Internal Control

50 views3 pages

Document Summary

Returning a value: methods as mechanisms for hiding complexity d. i. Information hiding = hiding lower level implementation so caller need not be bothered by them: methods as tools foor programmers rather than users. Programs = invoked by and serve needs of external user e. i. e. ii. Methods = program can invoke set of previously defined operations e. iii. readint is way to get input from user: methods calls as expressions f. i. Static methods = methods no associated with an object but instead are part of class as whole. Converts angle from degrees to radians: method calls as messages g. i. Messages = transmissions of info between objects g. ii. g. iii. Receiver = object that is target of transmission. This. println(value: writing your own methods, general syntax. Type = double, int, value returned or void if method returns no value. Private double celsiustofahrenheit(double c: return statement c. i. c. ii. If method returns result, method body must include one return statement.

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