CS 140 Lecture Notes - Lecture 3: Control Flow, Boolean Expression, Call Stack

29 views3 pages

Document Summary

Println will turn things into strings to print: two string method. Doesn"t care about indentation (use it tho it makes your code neater) the dot doesn"t have to be in the same line as a method or variable: ex evolution . stubstring(1,4); //it can be on a totally different line. If an else statement is there it skips to else. There can also be an else if for multiple cases checked after if in order: while(boolean expression){statement} Boolean expression check if something is true or false. Checks the boolean expression is done as long as boolean is true: do{program}while(boolean exp) Like the while loop but will always do the program at least once: for(init; bool exp; incriment){program} You must initialize variables, the prog checks bool exp to see if true. If true it"ll go through program once then increment. Mostly declare counter then check then increment. Java gives default constructor but can be changed.

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