zuai-logo
zuai-logo
  1. AP Computer Science A
FlashcardFlashcard
Study GuideStudy GuideQuestion BankQuestion BankGlossaryGlossary

What is control flow?

The order in which statements are executed in a program.

Flip to see [answer/question]
Flip to see [answer/question]
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.

What is a conditional statement?

A statement that executes code based on a true/false condition.

What is an 'if' statement?

A one-way selection statement that executes code if a condition is true.

What is a 'for' loop?

A loop that repeats a block of code a specific number of times.

What is a 'while' loop?

A loop that repeats a block of code until a condition is false.

What is a String?

A sequence of characters; an object in Java.

What is an Array?

A data structure that stores multiple values of the same type.

What is a Class?

A blueprint for creating objects; defines data and behavior.

What is an Object?

An instance of a class.

What is Inheritance?

A mechanism where a class inherits properties and methods from another class.

What is Polymorphism?

The ability of objects of different classes to be treated as objects of a common type.

What are the differences between 'for' and 'while' loops?

For: Used when the number of iterations is known. While: Used when the number of iterations is unknown, and depends on a condition.

What are the differences between == and .equals() when comparing strings?

==: Compares object references (memory locations). .equals(): Compares the content of the strings.

What are the differences between inheritance and polymorphism?

Inheritance: Allows code reuse and creates an 'is-a' relationship. Polymorphism: Allows objects of different classes to be treated as objects of a common type.