The order in which statements are executed in a program.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Flip
Revise later
SpaceTo flip
If confident
All Flashcards
What is control flow?
The order in which statements are executed in a program.
What is the purpose of conditional statements?
To allow programs to make decisions based on conditions.
Why is indentation important in code?
It improves code readability and helps identify code blocks.
What is the purpose of loops in programming?
To repeat a block of code multiple times.
Why are Strings immutable in Java?
To improve security and efficiency.
What is the significance of array indices starting at 0?
It's a convention in many programming languages for accessing array elements.
What is the relationship between classes and objects?
A class is a blueprint, and an object is an instance of that blueprint.
What is method overriding?
A subclass provides a specific implementation of a method already defined in its superclass.
What is the 'is-a' relationship?
A concept in inheritance where a subclass is a type of its superclass.
What is the purpose of the 'new' keyword?
To create a new object (instance) of a class.
How are conditional statements applied in real-world scenarios?
Controlling traffic lights, validating user input, decision-making in games.
How are loops applied in real-world scenarios?
Iterating through data in a database, repeating actions in a game, processing elements in an array.
How are Strings applied in real-world scenarios?
Storing and manipulating text data, processing user input, representing names and addresses.
How are Arrays applied in real-world scenarios?
Storing lists of items, representing game boards, managing collections of data.
How are Classes and Objects applied in real-world scenarios?
Modeling real-world entities (e.g., cars, people, bank accounts) in software.
How is Inheritance and Polymorphism applied in real-world scenarios?
Creating a hierarchy of animal classes where each animal makes a different sound, but all are treated as animals.
What are the steps to execute an 'if' statement?
1. Evaluate the condition. 2. If true, execute the code block. 3. If false, skip the code block.
What are the steps to execute a 'for' loop?
1. Initialize the loop variable. 2. Check the condition. 3. If true, execute the loop body. 4. Increment/decrement the loop variable. 5. Repeat steps 2-4 until the condition is false.
What are the steps to execute a 'while' loop?
1. Check the condition. 2. If true, execute the loop body. 3. Update the loop variable (if necessary). 4. Repeat steps 1-3 until the condition is false.
What are the steps to create an object from a class?
1. Declare a variable of the class type. 2. Use the 'new' keyword followed by the class name and parentheses. 3. Optionally, initialize the object's fields.