Java-201 Flashcards
What is a type-safe?
It preserves a method arg to assign illegal values
Are enums case senstives?
Yes
How can we get the reference of enums?
Volume level = Volume.LOW
Volume level = Volume.valueOf(“LOW”);
How many ways we can create threads
Two ways
By implementing the runnable in interface
And by extension to the athread class
Does the time of execution of thread is guaranteed
Nope
How many executors are defined by concurrency package
Executor
Executor service
Scheduled executor service
Does - is allowed in identifiers?
Nope
What is the regex pattern for space
\s+ (one or many)
What are Streams?
They are wrapper for Collections and arrays
Does Streams don’t store its elements.
No
Are Streams immutable ?
Yes
Are Streams reusable?
No, Once traversed , Need to create a new one
Does Stream support indexes access its elements?
No
Can stream execute its operations concurrently?
Yes need not to write MT
Does Stream operations are lazy when possible?
Yes , when someone calls(Subscribe virtually)