Java Part 1 Flashcards
What are packages?
Used to group related classes and avoid naming clashes
Use import statement to tell the compiler where to find classes
What are varargs?
Variable length arguments in a method declaration.
Must be last parameter
Elements passed in can be tuples or arrays
What is inheritance?
Used between classes where there is a strong is-a relationship.
Implemented by using the extends keyword.
What is an interface?
A class-like construct that is used to define behaviour
Can only have abstract methods and constants
What are callback methods?
Method that are created by us that get called in the runtime.
onCreate(), onResume(), onStop()
List types of errors.
Syntax,
Logic
Runtime
What are the 3 states program can be in?
Design time
Run time
Break time
What is a design time?
When you write or look at the code. The app is not running.
What is a run time?
When a program is running and doing what it was meant to do.
What is a break time?
When the program is in suspended animation. Statements are temporarily halted. Where debugging occurs.