Java Part 1 Flashcards

1
Q

What are packages?

A

Used to group related classes and avoid naming clashes

Use import statement to tell the compiler where to find classes

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

What are varargs?

A

Variable length arguments in a method declaration.
Must be last parameter
Elements passed in can be tuples or arrays

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

What is inheritance?

A

Used between classes where there is a strong is-a relationship.
Implemented by using the extends keyword.

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

What is an interface?

A

A class-like construct that is used to define behaviour

Can only have abstract methods and constants

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

What are callback methods?

A

Method that are created by us that get called in the runtime.
onCreate(), onResume(), onStop()

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

List types of errors.

A

Syntax,
Logic
Runtime

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

What are the 3 states program can be in?

A

Design time
Run time
Break time

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

What is a design time?

A

When you write or look at the code. The app is not running.

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

What is a run time?

A

When a program is running and doing what it was meant to do.

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

What is a break time?

A

When the program is in suspended animation. Statements are temporarily halted. Where debugging occurs.

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