Computer Science - Option D: Key terms and definitions

studied byStudied by 2 people
0.0(0)
learn
LearnA personalized and smart learning plan
exam
Practice TestTake a test on your terms and definitions
spaced repetition
Spaced RepetitionScientifically backed study method
heart puzzle
Matching GameHow quick can you match all your cards?
flashcards
FlashcardsStudy terms and definitions

1 / 37

flashcard set

Earn XP

Description and Tags

38 Terms

1

Class

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

New cards
2

New cards
3
New cards
4

Identifier

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

New cards
5

Primitive

the most basic data type available within the Java language

New cards
6

The 8 primitive data types:

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

New cards
7

Variable

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

New cards
8

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

New cards
9

Parameter variables

  • the passing of information/instructions into functions or procedures

  • Example: (int x, int y)

New cards
10

Arguments

the values that are passed into parameters

New cards
11

Local variable

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

  • Example: int age = 0;

New cards
12

Method

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

New cards
13

Accessor

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

New cards
14

Mutator

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

New cards
15

Constructor method

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

New cards
16

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)

New cards
17

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

New cards
18

Method signature

Combination of the method name and the parameter list

New cards
19

Return value

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

New cards
20

Method procedures

don’t return any value (void)

New cards
21

Method functions

return a value

New cards
22

The 3 Java access modifiers

public, protected, private

New cards
23

Public

can be accessed from any other class

New cards
24

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

New cards
25

Protected

accessed only by the subclasses

New cards
26

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

New cards
27

extends

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

New cards
28

Static

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

  • precede its declaration with the keyword static

New cards
29

Encapsulation

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

New cards
30

The 4 OOP Fundamentals

Abstraction, Polymorphism, Inheritance, Encapsulation

New cards
31

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

New cards
32

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

New cards
33

Super Class

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

New cards
34

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

New cards
35

Types of loops

While, do-while, count-controlled

New cards
36

Static arrays

do not change

New cards
37

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

New cards
38

Open source movement

supports the use of open-source licences….

New cards
robot