Computer Science - Option D: Key terms and definitions

0.0(0)
studied byStudied by 2 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/37

flashcard set

Earn XP

Description and Tags

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

38 Terms

1
New cards

Class

an extensible program-code-template for creating initial values for states (variables) and implementations of behaviours (functions/procedures/methods)

2
New cards

3
New cards
4
New cards

Identifier

a named pointer that explicitly identifies an object, class, method, or variable

5
New cards

Primitive

the most basic data type available within the Java language

6
New cards

The 8 primitive data types:

boolean, byte, char, short, int, long, float, double

7
New cards

Variable

a value that a program can manipulate in a named storage location, but must be declared before they can be used

8
New cards

Instance variables

  • Non-static variable

  • Declared in a class outside any method, constructor or block

  • Use access modifiers (private, public, protected)

  • Example: int engMarks, int mathsMarks

9
New cards

Parameter variables

  • the passing of information/instructions into functions or procedures

  • Example: (int x, int y)

10
New cards

Arguments

the values that are passed into parameters

11
New cards

Local variable

  • a variable defined within a block, method, or constructor

  • Example: int age = 0;

12
New cards

Method

a set of code that can be called at any point in a program by utilising the name

13
New cards

Accessor

returns the value of a private instance (class) variable, also known as a getter method

14
New cards

Mutator

control changes to an encapsulated instance (class) variable/state, also known as a setter method

15
New cards

Constructor method

an instance method that is invoked when an object of that class is created

16
New cards

Object creation rule in Java

When an object is created, one of the constructor method in the class must be invoked (to initialise the instance variables in the object)

17
New cards

The difference between method and constructor

Method

Constructor

Method can be any user-defined name

Constructor must be class name

Should have return type

It shouldn’t have any return type (even void)

Method should be called explicitly either with object reference or class reference

Be called automatically whenever object is created

Method is not provided by compiler in any case

Java Compiler provides a default constructor if there isn’t one

18
New cards

Method signature

Combination of the method name and the parameter list

19
New cards

Return value

Used to exit from a method, with or without a value.

20
New cards

Method procedures

don’t return any value (void)

21
New cards

Method functions

return a value

22
New cards

The 3 Java access modifiers

public, protected, private

23
New cards

Public

can be accessed from any other class

24
New cards

Private

  • can only be accessed within the declared class itself

  • classes can’t be private but methods and variables can

  • if public getter methods are present in the class, private variables can be accessed outside the class

25
New cards

Protected

accessed only by the subclasses

26
New cards

Summary of access

Modifier

Class

Package

Subclass

World

Public

Y

Y

Y

Y

Protected

Y

Y

Y

N

No modifier

Y

Y

N

N

Private

Y

N

N

N

27
New cards

extends

used in a sub class to inherit the properties of a super class

28
New cards

Static

  • a non-access modifier that is applicable for the following: blocks, variables, methods, nested classes

  • precede its declaration with the keyword static

29
New cards

Encapsulation

hiding methods or variables so other classes cannot manipulate them without going through

30
New cards

The 4 OOP Fundamentals

Abstraction, Polymorphism, Inheritance, Encapsulation

31
New cards

Inheritance

the mechanism by which one class is allowed to inherit the features (states and behaviors) of another class

includes Super Class and Sub Class

32
New cards

Advantages of inheritance

  • minimises the amount of duplicate code in an application by sharing common code amongst several subclasses

  • better organisation of code

  • code is more flexible to change

33
New cards

Super Class

The class whose features are inherited is known as a super class (or base class or parent class) 

34
New cards

Sub Class

The class that inherits the other class is known as subclass. The subclass can add is own states and behaviors in addition to the superclass states and behavior

35
New cards

Types of loops

While, do-while, count-controlled

36
New cards

Static arrays

do not change

37
New cards

Features of modern programming languages that enable internationalisation

  • Common character sets (e.g. Unicode, ASCII)

  • Platform independent high level languages let code run on many platforms5

38
New cards

Open source movement

supports the use of open-source licences….