Study sets, textbooks, questions
Upgrade to remove ads
Classes & objects
Terms in this set (20)
What is a class?
blueprint, template for objects e.g. chairs
What is a subclass?
Describes a subset of the objects of the superclass e.g. class= Cars, subclass = Toyota
What is an object?
instance of a class, belongs to a particular class & has individual characteristics e.g. specific blue chair
How are objects & classes different in when they exist?
For every class there can be many objects & objects can be created or destroyed. A class is a universal concept that is always there even if there are no objects
What do methods do?
Allow you to communicate with an object
What is a state?
The collective set of values in fields- defines the current look & feel of the object, values stored in the fields, every object has a state
Do all objects have the same state?
no all objects in the same class have the same fields/instance variables but the values stored in each are specific to that object
Wha does the source code if a class do?
Defines the class' attributes(what data objects store) & methods (what objects can do)
What do classes & source code have to do with concepts?
Classes model concepts. Source code realises those concepts
How do objects come into existence?
with pre-defined attribute values
What do methods do in depth?
Methods determine what objects do with their data. When a method is called, an object alters its state or uses its data to decide what to do
What happens at runtime?
objects interact with each other to realise the overall effect of the program
What are other words for field?
attribute, instance variable (instance emphasises the object is part of a class)
What is a formal parameter?
the name of the variable & its type e.g. int additionalPoints
What is an actual parameter?
the value stored in the parameter e.g. 30 stored in int additionalPoints
What is overloading?
When 2 different things have the same name e.g. can have the same method name with different signatures
What is a method signature?
the name of the method & formal parameters
Is return type part of the method signature?
no as you can't tell the difference between 2 methods with different return types but with the same signature when calling them
What is the return type + visibility + method signature?
What is class?
a data type e.g. string is a class
Sets found in the same folder
Understanding Class Definitions
Iterating over collections
Other sets by this creator
Introduction to databases
RTL for MARIE Instructions
Memory hierarchy, virtual memory