Basics Flashcards

1
Q

Class?

A

A blueprint that defines the variables and the method common to all objects of a certain kind.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Object?

A

Instances of a specific class.

A self-contained component which consists of methods and properties to make a particular type of data useful

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Subclassing?

A

A subclass reuses code from a base class, or the superclass

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Static methods?

A

Methods can be called without creating an object of a class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Instance methods?

A

Methods that requires an object of the class before the method can be called.

To invoke, create an object of the class within which the method is contained

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Variable?

A

Containers for storing datavalues (int, string…)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Attribute?

A

Metadata of a programs objects, whilst a variable is a program object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Abstract class?

A

Can not be instantiated, but can be subclasses. Define the base-behaviour of subclasses(objects)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Interfaces?

A

Completely abstract class used to group related methods with empty bodies. All methods defined by an interface must appear in a class which implements said interface

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Static types?

A

A type defined during compilation, and will be same throughout. Benefit that faults can be detected early and fix them.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Dynamic types?

A

Data decided at run-time(run-time polymorphism)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Interface inheritance?

A

When a class implements an interface, it and its subclasses inherit the methods within the interface

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Dynamic binding?

A

Choice between several different possible implementations of a polymorphic method(i.e. an overriden method), decided at run-time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Primitive types?

A

There are 8 primitve types… Stores values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Reference types?

A

Hold a reference to objects and provides a means to access those objects stored somewhere in memory. Includes integers, Arrays, Strings

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Overloading?

A

Two methods have the same nam, which one is chosen is at compilation(static)

17
Q

Overriding?

A

Subclasses overrides a method created in a superclass. Used when the implementation of a certain behaviour must be determined dynamically, stemming from the objects handling behaviour differently. Method is polymorphic.

18
Q

Encapsulation?

A

Information-hiding mechanism. Must declare class variables/attributes as private and provide public getters and setters.

19
Q

Superclass?

A

A class that defines the standard behaviour for subclasses which create objects

20
Q

Subclass?

A

A specific subtype of an object type, that inherits the attributes of the superclass

21
Q

Constructors?

A

Called at the creation of an object. It is defined in the class of the object, and should always have the same name as the class it is contained within. Not implicitly inherited by subclasses from superclasses. Its job is to initialize the instance varaibles of the object.

22
Q

Initilization?

A

Is a line of coe placed outside any method. Gives a variable its inital data

23
Q

Aliasing?

A

Means that more than one reference is tied to the same object