Java Flashcards
What is context switching in multi-threaded apps?
The time it takes to start processing another thread.
What is the sort algorithm for Arrays.sort()
QuickSort - dual pivot
What does SOLID stand for
- Single-responsiblity Principal
- Open-closed Principal
- Liskov Substitution Principal
- Interface Segregation Principal
- Dependency Inversion Principal
Which one is threadsafe StringBuilder or StringBuffer?
StringBuffer
What are two ways to create a task that can run in parallel?
- Extends Thread
- Implements Runnable
What is the Open-closed principal?
Open to change, closed to modification.
What is the Liskov Substitution Principal?
Polymorphism just works.
What is the Interface Segregation Principal?
Client should never be forced to implement an interface they do not use.
What is the Dependency Inversion Principal
Entities must depend on abstractions.
What is your perspective on the SOLID principals.
The Dependency Inversion Principal is pliable - tension with the YAGNI principal.
In java what do you call to start a thread?
start()