Class and Objects Flashcards
(86 cards)
A high level, powerful programming language that uses the ___________________ ______________ approach
Object-oriented Programming(OOP)
A programming style that models _________________ as “objects”
real-world entities
Data ( ____ ): information or attributes
fields
Object have: (2)
- data
- Behavior
Behavior( _____ ) : Actions or functions
methods
Programs are written as _______________________ or functions.
step-by-step instructions
Programs are written as step-by-step instructions or _____________.
functions
Focuses on ________ performed on ____.
- operations
- data
Becomes hard to manage as programs _______ and ________.
grow larger and more complex
OOP:
Organized code into ________.
reusable objects
Object-Oriented Programming:
Makes software development: ?
More structured.
Easier to scale.
Simpler to maintain.
Why Use OOP in Java?
Code Reusability
Easier Maintenance
Better Security
Real-World Modeling
Java’s Popularity
Code Reusability:
Write code once and reuse it multiple times, saving _____ and_____.
time
effort
Easier Maintenance:
______ is organized into______, making it simpler to debug and update.
Code
objects
Better Security:
_______ keeps data safe from _______ or _________.
Encapsulation
unintended access
modification
Real-World Modeling:
______mirrors how________, making it ________ and practical.
OOP
objects interact in real life
intuitive
A _________ is like a blueprint or template for creating objects.
class
A class is like a ______________ or template for creating objects.
blueprint
A class is like a blueprint or __________ for creating objects.
template
A class is like a blueprint or template for ____________.
creating objects
A class is like a blueprint or template for creating objects.
It defines:
_____________: Information about the object.
___________: Actions the object can perform.
Data (fields/attributes)
Behavior (methods)
Analogy:
Think of a class as a ________ for baking a cake.
The ____________ (data) and ______ (methods).
The _________ (objects) are created using the recipe, each with unique variations (e.g., flavors, decorations).
recipe
recipe lists ingredients
steps
actual cakes
Variables in a Class:
Instance Variables:
Class Variables:
Instance Variables:
Declared inside a class but outside any method.
_______ and unique to each object.
Non-static