Chapter 2 Flashcards

1
Q

What 5 benefits do we get from raising the abstraction of our code

A

1) Easier to write the program
2) Easier to understand.
3) Easier to debug.
4) Easier to modify.
5) We can create commands that may be reused.

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

SubClass vs SuperClass

A

superClass is the class that is higher up and the subClass inherits services from a superClass

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

What does calling super(); in a constructor do?

A

This will tell the constructor to look in a superclass for a constructor with the same parameters.

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

Define an implicit parameter

A

Is the object receiving the message, and allows us to use the “this” keyword.

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

Define inheritance hierarchy

A

It is the hierarchy of the classes that extend each other, it will include the highest superclass and the lowest subclass.

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

What 3 steps are involved in extending a class?

A

1) Create a new class that extends a class
2) Create a cosntructor for the new class that has the same name as the class.
3) Add a method for each of the services the new class should offer.

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

4 practices used by programmers concerning white space?

A

1) Begin each statement on a new line
2) Include at least one blank line between blocks of code with different purposes.
3) Line up curly braces so that the closing one is directly below the opening one.
4) Indent everything inside a pair of braces.

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

What is a special symbol?

A

Include braces, periods, semicolons, parantheses

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

What is a reserved word (keywords)?

A

Have a special meaning to the compiler ex) int, import, public

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

What is an identifier?

A

Are names of variables, classes, services, and packages

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

Define overriding a method.

A

Modifying a method from a superclass to meet your needs.

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

What 3 things do you need to do to override a method?

A

You need to create a method with the same name, return type and prarameters in the subclass.

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

Define recursion?

A

When a method calls itself.

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