Classes and Interfaces Flashcards

1
Q

Where can class definitions go in your source code?

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

Where can interface definitions go in your source code?

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

Where can interface definitions go in your source code?

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

True or false?: a class definition requires a code block.

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

I have a class definition. Now what?

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

What is a constructor?

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

How can you tell something is a constructor? (Which syntax gives it away?)

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

Can a class contain multiple constructors?

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

How can I use a class without a constructor?

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

True or false?: classes are types.

A

True

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

True or false?: interfaces are types.

A

True

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

Can I assign the value of a variable declared as an interface to a variable declared as a class?

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

Can I assign the value of a variable declared as a class to a variable declared as an interface?

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

What problem does an interface solve that isn’t solved by a class?

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

What is an abstract class? What problem does it solve that isn’t solved by an interface or non-abstract class?

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

What is the naming convention for classes?

A
17
Q

What is the naming convention for interfaces?

A
18
Q

Can class definitions be nested?

A
19
Q

What is the maximum number of methods a class should contain?

A
20
Q

What is the keyword for interfaces?

A

implements