1/27
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Class
A class is a set of fields and methods showing the structure of an object. They describe the type of object. They have one or more constructors. The information passed in changes which constructor is used. Can be a mix of primitive and reference types.
Object
An object is an instance of a class. Many objects can be created from a class. Objects have the behaviors defined in their class.
Inheritance
It means to receive properties and attributes from other classes. This new class can reuse, extend and modify the behavior defined in another class. Abstract classes are created solely for inheritance.
Advantages of inheritance
-This allows programmers to reuse code which saves time
-increase code quality
-ensure compatibility
Polymorphism
A primary concept of object oriented programming which allows a derived class method to be invoked through a base class reference during run time. This is enabled through late binding and overriding.
Overriding
Overriding is changing the behaviour of an inherited method from the derived class. This can be done by writing a method with the same name in the derived class that exists in the base method. It uses the ‘new’ keyword (also uses override keyword)
Overloading
Overloading allows the programmer to use multiple methods with the same name but different parameter lists. The methods must differ by the number, type or order of parameters. Overloading happens within the same class and it is resolved at compile-time. (Polymorphism)
Constructor
A special method within a class that is used to create objects of that class. Used in overloading
Perameterised constructor
The constructors in a class with one or more arguments. Parameterised constructors are used to create instances of objects with defined states. There can be more than one parameterised constructor in a class.
Abstract class
A class that can't be instantiated but serves as a class definition for derivation. Only contains abstract methods and properties.
Abstract Method
A method declared without a body within an abstract class. Derived classes are then required to provide the implementation for these abstract methods. This forces derived classes to define the specific behaviour of the method, which is useful for defining a common interface.
Late Binding
Late binding is the connection by a polymorphic base object to an overriding method during run time when the object type is known. This is used in polymorphism.
Parent / Super / Base
The class from which the subclasses are derived. An abstract class can only be used as a parent/super/base class.
Child / Derived / Sub
The classes which receive properties from other classes.
Method
A function associated with a class that defines the actions the objects of the class perform. Methods allow objects to execute specific behaviours and interact with other elements of the program.
Method Declaration
Visibility ReturnType Name(Parameters)
e.g. Public double Example(int A, string B) { }
Instantiation
The act of creating an object. Creating an instance of the class.
Interface
An interface is a fully abstract class. This means they can contain abstract methods and properties. To use an interface method, the interface must be implemented using the : heading of a class after the class name. The body of the interface method is provided by the implement class.
Exception
An unexpected error that disrupts the normal flow of a programs execution. It is the base class for Exception Handling. All other exception classes are derived from it.
Encapsulation
The process of defining a class by concealing its internal members from outside the class, and accessing those internal data members only through public methods or properties.
Visibility / Access Modifiers
The visibility of a variable determines how much of the program can access that variable.
Public
The public access modifier means the variable is accessible by any other class.
Private
The private visibility means it can only be accessed by code inside of the class.
Protected
A class member that is accessible within its own class and subclasses, but not from outside the package.
Static
Fixed or bound at compile time and cannot be changed. Only one copy of the class member exists. The class does not need to be instantiated for it to exist.
Static Methods
A static method is a method that belongs to a class rather than to an instance of the class. The method is still accessible to every instance. e.g. Cars.TopSpeed(); rather than myCar.TopSpeed();. The method is shared among all objects of that type. All objects share the exact copy of the method and its data.
Primitive Types
Primitive data sets refer to the standard data types built into a programming language. They are the basic data types which other types are constructed from. E.g. int, double, char, bool
Reference Types
Reference types store the address of the data rather than the data itself. They store more complex values than primitive types.