CS 106A Lecture Notes - Lecture 19: Local Variable, Javadoc, Instance Variable

37 views8 pages

Document Summary

Intro to java part 2: string type. Hello there: statement block, compound statement is set of statements enclosed in braces, variable"s scope is block in which it is declared, scope: liftetime of variable c. i. When and where variable is available to be used. Statement: condition = any boolean condition/variable, example. Println( num is even ): since only one line of statement, no need for braces; but always use braces. } else { statements: cascading if, one place where you don"t need braces. } else { println ( bad times ): switch statement. Int day = readint ( day of week as int: ); If day is 0, then a: when hits break statement, skips to end, for loop. Init is done once at start of loop. Int i = 0: condition is checked before each repetition through loop b. i. I< (number of repeats: step every time through loop after statements. For (int i = 0; i < 5; i++) {

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