AS SSD Defining Data Flashcards

(22 cards)

1
Q

What are the two main categories data types can be grouped into?

A

Primitive types and reference types

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

What are primitive data types?

A

They include int, string or floats.

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

What are reference data types?

A

They include types such as arrays or lists.

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

What is Object Oriented Programming (OOP)?

A

It makes use of objects and classes. It is just a collection of objects and classes interacting and working together.

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

What is an object?

A

Objects are used to represent one of a number of different things.

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

What is a class?

A

A class is simply a collection of objects.

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

What does a class consist of?

A

A class is made up using a constructor and a method.

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

Where are values assigned in a class?

A

They are assigned through the use of a constructor.

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

What are the three types of classes?

A

Abstract, base and inherited.

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

Why would you use inheritance?

A

By using inheritance, a class can inherit properties and behaviours of another class.

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

What would a base class contain?

A

A base class would contain variables that is applicable to every object. E.g. all animals have a name and an age no matter what species they are.

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

When would you an inheritance class?

A

When the variables within the base class can be used with an object. E.g. all dogs have a name and an age.

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

What are classes that inherit from another class called?

A

Derived classes

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

Why should inheritance be used?

A

Code can easily be reused throughout a program. This results in reduced development time and cost. Likewise when testing a program, only the inherited methods which are changed will need go be tested. this means less time will be spent testing parts of the code.

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

What would need to be passed into a derived class?

A

Values for variables used in the base class would have to be assigned in the derived class alongside any other new variables created in the derived class.

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

What are abstract classes?

A

Abstract classes are classes which cannot be instantiated directly.

17
Q

What can you not add in a method in an abstract class?

A

You cannot add the functionality for the method in the abstract class itself.

18
Q

What method would you use in a derived class to change the behaviour or functionality of it?

A

You would use the override method to change the functionality or behaviour of the method from class to class

19
Q

What is a static variable?

A

It is a special kind of variable that belongs to the class itself rather than to any specific instance of the class.

20
Q

What are some characteristics of static variables?

A

A static variable is shared among all of the objects of a class. If one object changes the value of the static variable, that change is reflected for all other objects of that class. The variables belongs to the class rather than the object. A static variable can be accessed without creating an object.

21
Q

What is an interface?

A

An interface is like the blueprint for a class. It defines what the class should do but not how it should do it.

22
Q

What are the characteristics of an interface?

A

An interface only declares methods and properties but does not provide the code for them. The class that implements the interface is responsible for defining the code. A class can implement more than one interface. This allows it to follow multiple sets of rules or behaviours.