The EVERYTHING Deck Flashcards

...because I'm too lazy to organize them by chapter (36 cards)

1
Q

Chapter 9: Inheritance

What is inheritance in Java?

A

the “is-a” relationship between a general superclass and a specialized subclass

Is-a = cat IS A pet, phone IS A device

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

Chapter 9: Inheritance

Why use inheritance?

A

makes using specific objects in a large progra easier; streamlines efficiency

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

Chapter 9: Inheritance

A specialized object has…

A

all characreristics of the general object, plus additonal ones that make it special

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

Chapter 9: Inheritance

What is a superclass?

A

the superior or more general class in a generalization or specialization relationship

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

Chapter 9: Inheritance

What is a subclass?

A

a class that extends a suoerclass, inheriting its attributes and behaviors

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

Chapter 9: Inheritance

What is another name for a superclass?

A

a parent class

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

Chapter 9: Inheritance

What is another name for a subclass?

A

a child class

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

Chapter 9: Inheritance

What is the interaction between child classes and private members?

A

the child class is unable to use it

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

Chapter 9: Inheritance

What is the interaction between child classes and public members?

A

the child class directly inherits it, as well as other parts of the program it can access

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

Chapter 9: Inheritance

What is the interaction between child classes and protected members?

A

The child class can modify data, but only if it shares the same package or subclass

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

Chapter 9: Inheritance

What is the super keyword for?

A

referring to the superclass

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

Chapter 9: Inheritance

What is a method signature made of?

A

a name and the parameter list

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

Chapter 9: Inheritance

What does @Override do?

A

Instructs the compiler that the annotated method will override one from a superclass or interface

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

Chapter 9: Inheritance

What is the final keyword for?

A

it’s for constants; prevents overriding of a superclass method in a subclass

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

Chapter 9: Inheritance

What is the class hierarchy?

A

The organization of classes in a hierarchal tree, where each parent class is a superclass and each child class is a subclass.

Relates back to inheritance

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

Chapter 9: Inheritance

Are all Java classes derived from a class named “object”?

A

Yes.

directly or indirectly, all classes ARE derived from the “object” class

17
Q

Chapter 9: Inheritance

What does a copy constructor do?

A

accepts an object of the same class as an argument

18
Q

Chapter 9: Inheritance

What is polymorphism?

A

The ability to take many forms. It can also reference objects of differing types, as long as it’s a subclass of its type

19
Q

Chapter 9: Inheritance

What happens with dynamic binding?

A

The type of an object isn’t determined until run-time

20
Q

Chapter 9: Inheritance

What happens with dynamic binding?

A

The type of an object is determined at some later time

21
Q

Chapter 9: Inheritance

What is an abstract class?

A

a class that only exists in a model; used for subclasses to inherit from

22
Q

Chapter 9: Inheritance

What is an abstract method?

A

A method with no body; must be overridden

23
Q

Chapter 10: Exceptions & Advanced File I/O

What is an interfact in Java?

A

a type with no instance variables; entire made of abstract methods and constants

24
Q

Chapter 10: Exceptions & Advanced File I/O

Can a class implement multiple interfaces?

25
# Chapter 10: Exceptions & Advanced File I/O What are default methods?
an interface method with a body
26
# Chapter 10: Exceptions & Advanced File I/O What are anonymous inner classes?
an inner class with no name; declared and instantiated at the same time, often used for one-time event handlers
27
# Chapter 10: Exceptions & Advanced File I/O What are lambda expressions used for?
defining anonymous functions or creating functions that are passed as arguments to other functions
28
# Chapter 10: Exceptions & Advanced File I/O Why do people use interfaces, anonymous classes, and lambda functions?
encapsulates small, localized behaviors; stores the state of fields within functions that constantly create new variables
29
# Chapter 10: Exceptions & Advanced File I/O What is a text file?
a series of plain text, stored into just one file
30
# Chapter 10: Exceptions & Advanced File I/O What is a binary file?
a file filled with unformatted binary data
31
# Chapter 10: Exceptions & Advanced File I/O How do you declate a printwrite?
`PrintWriter outputFile = new PrintWriter("filename.txt")`
32
# Chapter 10: Exceptions & Advanced File I/O What is a buffer?
a small "holding section" of memory
33
# Chapter 10: Exceptions & Advanced File I/O What is a delimiter?
an item that separates other items in reading lines
34
# Chapter 10: Exceptions & Advanced File I/O What is an exception?
a signal that indicates the program cannot continute until the unexpected event has been dealt with | AKA an error that DOESN'T immediately crash the program
35
# Chapter 10: Exceptions & Advanced File I/O What is a read position?
a marking of the location in regards to the next item read in a file
36
# Chapter 10: Exceptions & Advanced File I/O What is an exception handler?
a section of code that responds to exceptions