EXAM 2 Flashcards
What are the 4 benefits of using methods
Reusability, Breaking down complexity, Redeable to user, allows a user to focus on what a method does not HOW it does it
example of sentinel loop
while loop
example of count controlled loop
for loop
list all necessary import statements
import java.io.*
import java.util.*
program header
public class name{
public static void main(String[] args){
} }
what to say for throws
throwsFileNotFoundException
what does a break statement do
exits the loop entirely
what does a continue statement do
skips to the next iteration of the loop
format of a switch statement
switch (int n){
case 5:
case 10:
case 20:
default:
}
what is recursion
A method calling the method itself within
Base recursive case
the condition to stop recursion
Recursive case
a method calling itself