OOP module 6 Flashcards

1
Q

A programming style in Java and other programming langauges intends to make thinking about programming closer to the real world.

A

Object-Oriented Programming

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

Objects also have _______, which are used to describe them. For example, a car can be red or blue, a mug can be full or empty, and so on. These characteristics are also called ________

A

Characteristics, Attributes

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

An attribute describes the current ____of an object.

A

State

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

The same applies to program objects, as ______ is specific to the object’s type.

A

Behavior

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

A _____ describes what an object derived from it will be, but is a completely separate entity from the object itself.

A

Class

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

Methods define _______

A

Behavior

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

A ______ is a collection of statements that are grouped together to perform an operation

A

Method

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

An example of a method is the _______________________________.

A

System.out.println() method.

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

______ a method can be done as many times as necessary.

A

Calling

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

You can also create a method that takes some data, called ________, along with it when you call it.

A

parameters

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

Parameters can be written within the method’s __________

A

parentheses (( ))

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

The method in the example takes a String called ____ as a parameter, which is used in the method’s body. Then, when calling the method, we pass the parameter’s value inside the parentheses.

A

Name

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

Methods can take multiple parameters, each separated by a ______.

A

comma (,).

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

The _____keyword can be used in methods to return a value

A

return

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

The _____ keyword can be used to allow declaration of static variables and methods that belong to the class instead of a specific instance (such as the main method):

A

static

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

A class has _______ and ______.

A

attributes and methods

17
Q

______ is an access modifier, meaning that it is used to set the level of access:

18
Q

_______ The class is accessible by any other class.

19
Q

________: The class is accessible only by classes in the same package – a group of similar types of classes.

20
Q

_________- provides the same access as the default access modifier, with the addition that subclasses can access protected methods and variables of the superclass.

21
Q
  • accessible only within the declared class itself.
22
Q

Used to effectively protect data, particularly when creating classes.

A

Getter and Setter

23
Q

For each variable, the ___ method returns its value, while the ___ method sets the value

24
Q

The _______________ returns the value of the attribute

A

getter method

25
Q

The ____________ takes a parameter and assigns it to the attribute.

A

setter method