Page 182 - computer science (868) class 11
P. 182
Let’s Revisit
♦ Expression statements consist of an expression hat calculates certain equations and produces a result.
♦ Declaration statements are used to declare what type of data the variables or constants will contain.
♦ Control statements are used to decide in which direction the program will execute.
♦ The scope of a variable is the part of a program in which the variable is accessible.
♦ When a group of statements is written within a curly bracket, then it is known as a compound statement.
♦ The statements that are executed sequentially and represent the default flow of the program are known as sequential
statements.
♦ Conditional statements follow the conditional flow of control.
♦ Switch case is a multiple-branch selection statement in which multiple conditions can be checked at once.
♦ The situation of moving of control from one case to another case in the absence of a “break” statement is known as Fall
Through.
♦ Repetitive flow of control in a program is called a Loop and the repetitive statements are called iterative statements.
♦ The Java for loop executes a set of statements repeatedly for a fixed number of times.
♦ The Java while loop is used to execute a set of statements repeatedly based on a given condition.
♦ The Java do-while loop executes a set of statements repeatedly until the specified condition is true.
♦ When a loop is present inside the body of another loop, it is called a Nested loop.
♦ The break statement is used to exit from the loop or switch statement.
♦ The continue statement works the same as the break statement, but instead of sending the statement outside the loop or
switch, it is used to direct the control by sending it to the next iteration in the loop or switch.
♦ In Java, when a method is called, the control is transferred to the method and it must return back to the caller module after
the execution of the method.
♦ The built-in methods are also called library or system methods.
MIND DRILL
Solved Questions
A. Tick ( ) the correct option:
1. Which of the following is not a type of statement in Java?
a. Expression Statements b. Declaration Statements
c. Control Statements d. None of these
2. Which statement is used to calculate certain equations and produce a result?
a. Expression b. Declaration
c. Control d. None of these
3. Which statement in Java follows the top-down approach?
a. if-else statement b. Switch case
c. Sequential Statement d. None of these
4. Which of the following statements checks a particular condition?
a. switch case b. if statement
c. for loop d. Both a and b
5. What will be returned by the following?
if(67%2==0)
a. True b. False
c. Odd number d. Even number
180180 Touchpad Computer Science-XI

