Objects and Classes Flashcards
What are objects?
They’re program modules that can do actions or be acted upon by other objects.
What are properties and behaviours of objects?
Properties are data about the object, such as attributes or fields or instance variables. While behaviours are methods, like instance methods.
What has to happen before an instance method is called?
An object of that class must be called before a method of its class can be called upon it.
What’s an analogy for a class?
A template, model or definition for objects of that class.
Does every object belong to a specific class?
Yes, and objects that belong to the same class have the same properties and can perform the same actions.
What do Object-oriented programs consist of?
Interacting objects, namely objects that are defined by classes and can be created by objects of other classes (client classes). Typically used in implementing a programming solution to a problem.
What does a class definition consist of?
Attribute declarations (instance/field variables), Constructor definitions, Method definitions
How is a class definition stored?
In a file with the same name as the class and a .java extension.
Describe the Software Life Cycle
- Problem specification
- Design (algorithms and data structures)
- Implementation (translate design into code)
- Testing and debugging.
Describe Modular Design
Breaking a complex problem into smaller isolated problems, (modules). Each module contains data and code, part of a module is kept hidden from other modules to achieve independence (private and public).