Intro to OOP Flashcards

1
Q

Functions

A

write an algorithm once to be used in many situtations

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

Objects

A

group a related set of attributes and behaviors into a class

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

Frameworks and APIs

A

large groups of objects that support a complex activity

can be used “as is” or be modified to extend the basic behavior

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

Class

A

A blueprint from which an object is actually made

Describes the state or the data that each object contains

Describes the behavior that each object exhibits

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

three key features of OOP in classes

A
  • Encapsulation
  • Inheritance
  • Polymorphism
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

keyword to create an instance of a class

A

new

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

functions that provide processing to the object’s data

determines the behavior of an object

A

Methods

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

Collection of all publicly available methods

A

Class Interface

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

Accessing object members

A

dot notation

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

hides the implementation details of a class

A

Encapsulation

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

a method that is automatically invoked when an object is created. It is normally used to initialize data members.

A

Constructor

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

Default constructor

A
  • default constructor if not overwritten
  • takes no arguments
  • no body
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

what happens when new is called

A
  1. Memory is allocated for the new object and instance variables are initialized to their default values
  2. Explicit attribute initialization is performed
  3. The appropriate constructor is executed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Parameter passing in Java

A

Java only passes parameters by value
When an object is passed as a parameter to a method, only the reference is transmitted

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

package statement

A

allows for the grouping of classes

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

import statement

A

specifies the directory of the packages/classes to be used

17
Q

Inheritance

A
  • Extends existing classes to support new abstractions
  • Factor common attributes and methods in superclass
18
Q

Method overriding

A
  • the method name from the parent class can be overriden
  • If the method has different number and type of parameters, it is still overloading, but if the method has exactly the same signature, it is called overriding.
19
Q

root of all classes in Java