CSE 8A Lecture 5: Fall 2016: Lecture 5 Notes

28 views2 pages

Document Summary

Two types of variables: primitive (lower case) Values go inside box: objects (upper case) Inside the boxes are a reference pointing to actual object: return goes before method name. Must return the value or variable of the type you declare (return type before method name) Not necessarily needed if return type is void public int returnanint (int myint) { // some code here return myint: assigns the result of this method to an int since method returns an int. Ends the loop if stated in a loop for (initialization; test; increment) : // code , this is a for loop. Just like a while loop: initialization initializes looping variable. Run once at the beginning of loop: test if false, loop stops running, increment increments looping variable. Run at end of each loop: each time this is run, the test must be checked.

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