05 - Program Development Flashcards

1
Q

Define the term ‘class’ in Object Oriented Programming.

A

A class can be defined as a template/blueprint that describes the object of its type.

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

What is an identifier?

A

An identifier is a pointer that explicitly defines an object, class interface, method, or variable.

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

What are the three types of variables in Java?

A

1) Instance Variable: Declared inside a class but outside any method. It belongs to an instance (object) of the class and stores object-specific data.
Example: String name;

2) Parameter Variable: Declared inside a method’s parentheses. It stores values passed to the method when it is called.
Example: public void greet(String name)

3) Local Variable: Declared inside a method or block. It is accessible only within that method/block and is created and destroyed when the method/block runs.
Example: int sum = 5 + 3;

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

What is an instance variable?

A

A variable in a class from which every instantiated object gets its own copy.

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

What is a parameter variable?

A

A variable that is passed along to a function to perform operations.

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

What is a local variable?

A

A variable declared inside a function, known and only accessible by that function.

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

Define the term ‘method’ in Java.

A

A Java method is a collection of statements that are grouped together to perform an action.

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

What is an accessor method?

A

An accessor method is used to return the value of a private field, prefixed with ‘get’.

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

What is a mutator method?

A

A mutator method is used to set a value of a private field, prefixed with ‘set’.

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

What is a constructor in Java?

A

A constructor is the method that is called when an object is instantiated.

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

What is a method signature?

A

A method signature is a combination of the method name and the parameter list.

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

What does the private modifier specify?

A

The member can only be accessed in its own class.

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

What does the protected modifier specify?

A

A member can only be accessed within its own class/package and by a subclass.

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

What does the public modifier do?

A

A class declared with public is visible to all classes everywhere.

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

What is inheritance in programming?

A

Inheritance is the process where one object acquires the properties of another.

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

Define the static keyword in Java.

A

The static keyword means that the variable or functions are shared between all instances of that class.

17
Q

What are primitive data types used for?

A

To store simple values and as building blocks of more complex abstract data types.

18
Q

Is String a primitive data type?

A

No, String is not a primitive data type, but is considered a ‘basic’ data type.

19
Q

What are some features of modern programming languages that enable internationalism?

A

1) Use of common character sets like UNICODE
2) Platform independent high level languages

20
Q

Discuss possible ethical obligations of programmers.

A

1) Adequate testing of products
2) Acknowledgment of work of other programmers
3) Open Source movement
4) Robotics and artificial intelligence