CC103 MIDTERM REVIEWER

0.0(0)
studied byStudied by 32 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/30

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

31 Terms

1
New cards

a situation when we need to execute a block of code several number of times,

loops

2
New cards

a control structure that allows you to repeat a task a certain number of times.

while loop

3
New cards

syntax of while loop:

while(Boolean_expression) {

// do this

}

4
New cards

is similar to a while loop, except that it is guaranteed to execute at least one time.

do - while loop

5
New cards

syntax of do-while loop:

do {

// do this

} while(Boolean_expression);

6
New cards

a repetition control structure that allows you to efficiently write a loop that needs to execute a specific number of times.

for loop

7
New cards

syntax of for loop:

for(variable initialization; Boolean_expression; update){

// do this

}

8
New cards

is mainly used for Arrays.

enhanced for loop

9
New cards

syntax of enhanced for loop

for(declaration : expression){

//Statements

}

10
New cards

a type compatible with the elements of the array you are accessing. The variable will be available within the for block and its value would be the same as the current array element.

Declaration

11
New cards
  • This evaluates to the array you need to loop through

  • can be an array variable method call that returns an array.

expression

12
New cards

used to break the loop.

break

13
New cards

make the loop jump to the next iteration.

continue

14
New cards

allow you to make a decision, based upon the result of a condition.

decision-making

15
New cards

types of decision making in java:

  • if statement

  • switch statement

16
New cards

java looping mechanisms

  • for loop

  • do while

  • while

17
New cards

consists of a Boolean expression followed by one or more statements.

if statement

18
New cards

executes when the Boolean expression is false.

if else

19
New cards

In case that the first condition returns false

else if

20
New cards

is not required but a good thing to do if you need to handle possibilities

else

21
New cards
  • you can use one if or else if statement inside another if or else if statement.

  • if your code has multiple conditions to achieve

nested if

22
New cards

selects one of many code blocks to be executed.

switch statement

23
New cards

used to declare the beginning of the statement followed with the variable or expression to be validated.

switch

24
New cards

used to declare the possible value that the expression might have.

case

25
New cards

used to declare the action or code block to run if there is no cases satisfied. Also not required.

default

26
New cards

These represent serious problems that a typical application should not attempt to handle.

error

27
New cards

These indicate conditions that a program might try to catch and handle. They represent problems that can occur during the execution of the program, often due to issues within the code itself or external factors.

exceptions

28
New cards

These exceptions must be either caught using a try-catch block or declared in the method signature using the throws keyword.

checked exceptions

29
New cards

Also known as runtime exceptions, these do not need to be explicitly caught or declared. They typically result from programming errors,

unchecked exceptions

30
New cards

allows you to create a custom error. It can be used together with an exception type.

throw statement

31
New cards

lets you execute code, after try...catch, regardless of the result.

finally statement