02 Prelim CP2 Flashcards

1
Q

A type of paradigm in which programmers can define key programmkng concepts (such as data structures and the types of operations that can be applied to them.)

A

Object-Oriented Programming (OOP)

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

In object oriented programming, each object has 3 dimensions:

A
  1. Identity
  2. Attributes
  3. Behavior
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

A (1)_______ ___ in (2)_____ and other programming languages intends to make (3)______ about programming (4)______ to the (5)_____ world.

A
  1. Programming style
  2. Java
  3. Thinking
  4. Closer
  5. Real
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

In OOP, each object is an (1)_______ ____ with a (2)_____ identity, just as objects in the (3)_____ world are. This allow program objects to properly (4)______ their real-world (5)_________.

Ex. An apple is an object, so is a mug. Each has its unique identity.

A
  1. Independent unit
  2. Unique
  3. Real
  4. Represent
  5. Counterparts
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Objects also have (1)______, which are used to (2)______ them.

Ex.
A car can be red or blue, a mug can be full or empty, and so on.

These (1)_______ are also called (3)________.

A
  1. Characteristics
  2. Describe
  3. Attributes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

An attribute describes the current (1)______ of an object.

In the real world, each object behave in its osn way; a car can move, a phone can ring or vibrate, and so on.

The same applies to (2)______ objects, as (3)_______ is specific to the object’s type.

A
  1. State
  2. Program
  3. Behavior
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
  • A group or collection of OBJECTS having similar or common properties
  • each _______ has a name, and each is used to define attributes and behavior.

Ex.

Attributes
- name
- weight
- age

Behavior
- walk
- run
- sleep

A

Class or classes

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

A (1)______ describes what an object derived from it will be, but is a completely separate (2)______ from the (3)_______ itself. In other words, (4)______ can be described as (5)_______, (6)_________, or (7)_______ for an object.

A
  1. Class
  2. Entity
  3. Object
  4. Classes
  5. Blueprints
  6. Descriptions
  7. Definition
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

(1)_______ is a collection of (2)______ that are group together to perform an (3)________.

An example of (1)_________ is the:
(4)_______________

(1)______ define (5)______

You can (6)______ your own (1)______ to perform your desired task

A
  1. Method
  2. Statements
  3. Operation
  4. System.out println() method
  5. Behavior
  6. Define
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the method in this program:

class MyClass {

static void sayHello() {
system.out.println(“Hello World!”);
}

public static void main (String [] args) {
sayHello();
}
}

// output: Hello World!

A

static void sayHello() {
system.out.println(“Hello World!”);
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
  • (1)________ a method can be done as many times as (2)_______.
  • When method runs, the code (3)______ to where the method is (4)_____, executes the (5)_____ inside of it, then goes (6)______ and proceed to the (7)______ line.
A
  1. Calling
  2. Necessary
  3. Jumps
  4. Defined
  5. Inside
  6. Back
  7. Next
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

(1) ______ _______

  • You can also create a method that takes some data, called (2)_____, along with it when you call it.
  • Parameters can be written within the method’s (3)_________

For example, we can modify our sayHello() method to take and output a String parameter:
The method in the example takes a String called name as a parameter, which is used in the method’s body. Then, when calling the method, we pass the parameter’s value inside the (3)_____.

  • Methods can take (4)_______ parameters, each separated by a (5)________.
A
  1. Method parameters
  2. Parameters
  3. parentheses (( ))
  4. Multiple
  5. Comma (,)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Advantages of using methods instead of simple statements in Java programing:

A
  1. Code reuse
  2. Parameter passing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

You can write a method once, and use it multiple times on multiple classes without having to rewrite the code each time on each
class.

A

Code reuse

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

Based on the parameters passed in, methods can perform various actions.

A

Parameter passing

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