1322 Programming 2 Flashcards

(272 cards)

1
Q

What does a class define?

A

The properties and methods of an object

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

Is Java an interpretted or compiled language?

A

Compiled

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

How many main methods can I have per class?

A

1

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

What are the naming principles of Java?

A

Constants and classes should begin with a capital
Variables and methods should not start with numbers or capitals
Avoiding keywords.

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

What are primatives?

A

Variables that store simple pieces of information

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

How is an object stored in a variable?

A

As a reference to that object in the heap.

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

What is scope?

A

Member variables can be accessed anywhere in the class while local variables can be accessed only from the method in which they are defined

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

How can we prevent variable shadowing?

A

Using the keyword this which always refers to the member variable.
Also by naming your variables properly.

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

What is the difference between print and println?

A

println adds a newline character after your text

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

T/F Multiple returns from a method is possible in Java

A

False

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

What is overloading?

A

When two methods share the same name but have different parameters and implementation

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

In the JVM, how is a method recognised?

A

By it’s signature (its name, parameters and their order)
Note this doesn’t include return type.

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

What is encapsulation of classes?

A

The bundling of data, with the methods that operate on that data

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

Why do we define attributes as private?

A

To protect encapsulation by preventing direct access from external classes

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

What is an array for?

A

Grouping things together

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

What can an array hold?

A

Objects or primitives

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

What is the difference between an array and arrayList?

A

Arrays are fixed size and require knowing the index while arrayList are unbounded size and don’t require knowing the index.

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

Why can I add an int to an arrayList?

A

They can only hold objects so we need to wrap an int in an Integer

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

Why would you use an iterator?

A

As they decouple the loop from the collection, so we can pass the iterator without the function knowing about the collection

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

What do iterators do?

A

Track progress through a collection

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

T/F We use == to compare objects in Java

A

False.
We use the .equals method instead

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

Why do we use inheritance?

A

Because duplication is bad, so we want to write a common template

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

What is a superclass?

A

Any class that is inherited from

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

What does a subclass inherit from a superclass?

A

All it’s protected and above properties and methods.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What are the three pillars?
Encapsulation Inheritance Polymorphism.
26
What are the 4 access modifiers?
Public: Everyone Protected: class, subclasses, package Default: class and package Private: class
27
What does they method super() do?
Call the constructor of the superclass
28
When do you not need to have the super keyword in the constructor of a subclass?
When the superclass has no parameters.
29
What class is the ultimate superclass?
Object
30
Is there a keyword for overriding a method?
No
31
Can a method overriding a public method be private?
Nope. They have to have the same or less strict access modifier.
32
What is polymorphism?
The combination of substitution, overriding and dynamic binding.
33
What is substitution?
Storing a reference to a subclass in an variable of the superclass
34
What do overriding and substitution combined do?
It allows us to store in a superclass and execute the subclass overriden methods.
35
What does the instanceof keyword do?
Allows us to check if an object is of a specific class.
36
Why is the instanceof keyword bad practise?
As it is slow and therefore best avoided.
37
If the this keyword can't find properties in this class what will it do?
Check superclass
38
Can an abstract class be instantiated?
No it can only be extended
39
What is a concrete class?
A non-abstract class
40
What does having abstract methods do?
It forces subclasses to override the method
41
What does abstract methods and classes enable?
Code for polymorphism without having to write methods that will never be called
42
Does a class with abstract methods have to be abstract as well?
Yes. But an abstract class doesn't have to have all abstract methods or even one.
43
What is an interface?
An abstract class that contains only abstract methods.
44
How many classes can a class extend?
1
45
How many classes can a class implement?
Infinite
46
What is agile development?
Embracing the iterative process by separating projects into smaller sprints.
47
What is waterfall development?
More traditional approach, involving a linear flow by dividing a project into phases
48
Why was the agile development cycle created?
For projects where the significant constraints are not well understood.
49
What is abstraction?
Relating to o involving general idea or qualities rather than specific people, objects, or actions
50
What is a model?
An abstract representation of a system that enables us to answer questions about the system
51
What are the purposes of modelling?
Insight Understanding Communication Sharing mental models
52
What is modelling?
Complex software designs that would be too difficult to describe textually can be readily conveyed through diagrams.
53
What is an As-Is and To-Be model?
As-Is: A model that describe the system now To-Be: A model that describes the system as it will be.
54
What does UML stand for?
Unified Modelling Language.
55
What is a class modelling?
A specialised type of modelling concerned with the general structure of a system to determine how the system will satisfy its requirements.
56
What is a UML class?
Defines a type of object and it's structural and behavioural features
57
What does # mean next to a method in UML?
Protected access modifier
58
What is aggregation and it symbol?
A has-a relationship with weak lifecycle dependency White diamond
59
What is composition?
A contains-a relationship with a strong lifecycle dependency. Black diamond
60
What is the symbol for inheritance in UML?
A white arrow
61
What does <> represent in UML?
An interface
62
What is a structural UML diagram?
Emphasises the static structure of the system using objects, attributes, operations and relationships.
63
What is a behavioural UML diagram?
Emphasises the dynamic behaviour of the system by showing collaborations among objects and changes to objects
64
What type of UML diagram is a sequence diagram?
Behavioural
65
What are the two axes of a sequence diagram?
Horizontal: Elements involved in interactions Vertical: Represents time proceeding down the page.
66
What is a control element?
An element which organises and schedules the interactions between the boundaries and entities and serves as the mediator between them
67
What is a boundary element?
A system boundary, e.g user interface or database gateways.
68
What is the difference between a synchronous and asynchronous message?
An asynchronous message doesn't require a response before the interaction can continue
69
What is the symbol for a return message?
A dotted arrow
70
In a communication label, what is a guard?
An optional piece of info that species a condition that must be met.
71
What is the difference between a found and lost message?
A found message is where the sender is unknown A lost message is where the receiver is unknown
72
What is a reflexive message?
When an object sends a message to itself.
73
When is the alternative fragment used?
When a choice needs to be made between two or more messages
74
What is the option combination fragment?
Indicates a sequence will only occur under certain conditions
75
What is the parallel fragment?
Represents the parallel execution of interactions.
76
What is the reference fragment?
A fragment that uses or calls another interaction. Used for simplifying large and complex sequences.
77
What is recursion?
Chacterising something entirely in terms of itself.
78
Why do we use recursion?
It can help conceptually by breaking big problems into smaller sub problems.
79
Why is a tree recursive?
As it contains a value and a left and right tree.
80
When is a recursive call not added on to the stack?
When the parameters don't change
81
When shouldn't we use recursion?
Perpetual loops
82
What is the disadvantage of recursion?
They are inefficient
83
Why do we prefer exceptions to if statements?
If statements produce unreadable code.
84
What is an exception?
An exceptional event that disrupts the flow of the program.
85
What happens when an exception is thrown?
The method creates an exception object and hand it to the runtime system, resulting in immediate halting/
86
How many types of exception can a method throw?
As many as needed.
87
What are the two ways of handling an exception?
Catching Deferring: the method above problem.
88
What happens if an exception is uncaught?
It will halt the execution of the program.
89
What ae the two categories of exception?
Checked and unchecked
90
T/F the JVM will force you to handle an unchecked exception.
False Only checked exception handling is required.
91
What are the unchecked exceptions?
Runtime exception and it's subclasses
92
What is the difference between a checked and unchecked exception?
An unchecked exception cannot be predicted by the compiler while a checked exception can.
93
Why do we write unit tests instead of normal tests?
Less test writing Time: Long term productivity benefits Early bug detection Improve design
94
What is the difference between white and black box testing?
White-box is when you know the internal structure, black-box is when you don't know.
95
What are we testing in white-box?
The methods and structures work as intended.
96
What are we testing with black-box?
Whether an input gives the correct output behaviours for a syste,
97
What is the difference between unit, integration and system testing?
Unit: testing code in small isolated pieces Integration: Testing the combination of larger collections of units System: testing the entirety of the developed system
98
What is a seam?
The boundary between the unit being tested and other classes it collaborates with.
99
What is a stub object?
A "fake" subclass of B that is used to test A.
100
What does parameterised test?
We can run a test suite with varying data.
101
What object serialization?
Flattening an object to convert it to a stream of bytes.
102
What is similar between file handling and network transmission?
Its all just a stream of bytes.
103
T/F Input and Output streams are separate objects in Java
True
104
What are the steps for I/O operation?
Get the fille ready with File class Set up stream Read or write to it Close the stream
105
What class is for reading one line at a time?
BufferedRead
106
What are pipeline streams for?
Communication between threads
107
When is an object serializable?
When it implements the serializable interface.
108
What class is used to serialize objects?
ObjectOutputStream.
109
What parts of an objects are serialized?
Only the properties, all objects of the same class share the same methods.
110
What is object versioning?
Classes can change over time, so serialized objects are given a 64-bit hash, an object cannot be deserialised into a class if their hashes don't match.
111
What happens if a serializable class has an reference to another class as a property?
The JVM will serialize every object that is heap reachable from that object via recursion. All of these objects must be serializable as well.
112
What are the conditions for serializing an object?
Declared as serializable All fields are primitives or String Other types that are serializable.
113
Is a static property serialized?
No
114
What is externalizable?
Serializable but we can specify what is serialized.
115
What does the keyword transient do?
Specifies that the value of a property should not be serialized and will be null when deserialized
116
What is the default implementation of serialization?
What a hashcode of the current class obejct Serialize the fields - Ignore static Ignore transient Use a fixed encoding for primtives and string Recursively class writeObject on any reference type.
117
What is a virtual machine?
A machine with it's own architecture and instruction set built-in software rather than hardware
118
What is the architecture of the JVM?
A high-level abstract description of how a JVM implementation should behave. Expressed in terms of abstract components, the implementation is left to the implementors.
119
What are the three key areas of the JVM?
Class loader Memory Execution engine.
120
What does the class loader do?
Locates .class files, and verifies that they represent well-formed bytecode classes before loading them into the method area of shared memory, before linking and initialising class variables
121
What are the two areas of memory?
Shared and private
122
T/F The JVM has a program counter.
True
123
What is the Java Stack?
Holds information for a thread, which methods have been called. As well as local variables, parameters and performing calculations
124
What is the execution engine?
Describes how the bytecode is actually executed and what the expected behaviour should be, this is in terms of the JVM instruction set.
125
T/F Each Java thread has an instance of the execution engine
True
126
What is common practise for the implementation of the method area?
Use tables, where each type has a table of pointers to code for all methods, including inherited ones.
127
Why can we only talk about common practise for the method area?
As the structure and organisation of the method area is not predefined in the JVM spec, so it is implementation specific.
128
Is the method area in private or shared memory?
Shared
129
What is the constant pool?
An ordered list of constants used by the class, these are literals and references
130
If we have a reference to class Foo, how does the constant pool deal with this?
If Foo is already loaded, then we replace this with a reference to Foo, otherwise we load Foo.
131
What lives in the heap?
Object instances
132
What does each instance in the heap contain?
The values of all objects instance variables, including inherited ones. A pointer to object's type in the method area. This is for overriding. Data structures relating to synchronising thread access associated with it. A lock and wait queue
133
How are arrays treated?
They are objects on the heap, but beyond that is implementation specifc
134
What is meant by the implementations of the JVM?
As java runs across multiple devices so there are multiple implementations of JVM for many OS.
135
What is in thread local memory?
Program counter and the stack.
136
What does a program counter contain?
A pointer to the method area to the current instructions
137
What is a stack frame?
The unit of operation for the Java Stack, they contain state information for the execution .
138
What happens a new method is called?
A new frame is pushed onto the stack, all local variables, parameters, and temporary calculation is done within this frame.
139
What happens when a method terminates?
Its frame is popped off the stack and discarded.
140
What happens when a method calls another method?
A new frame is added on top, and popped off when finished. Using the return address on the frame.
141
What does the dumpStack method do?
Forces an exception to dump the current state of the stack onto system.out
142
What does declaring a property as static do?
Shares values across all instances of the object.
143
What is another name for a static variable?
A class variable
144
What is a static method?
Invoked on the class rather than the instance and cannot depend on the instance.
145
What does the keyword final?
Prevent a variable from changing after it is constructed.
146
What is a design pattern?
A reusable, general solution to a common software design problem.
147
Why do we use design patterns?
Maintainable scalable Flexible Code readability Encapsulation
148
What are the creational design patterns?
Singleton: One instance of a class exists`1` Factory method Abstract factory Builder Prototype
149
What are structural design patterns?
Focus on class and object structure, ensuring objects are combined efficiently.
150
What is the composite structural design pattern?
Treats individual and composite objects uniformly
151
Can an interface have a static method?
Yes
152
What is the functor pattern?
Objects that contain only a single function, implement an interface containing a single function.
153
Why do we use the functor pattern?
To vary how an operation is performed without changing the method that implements an algorithm. Decouple the application from the implementation and encapsulate the implementation
154
How does Java 'have' function pointers?
Lambdas
155
What is a functional interface?
An interface with a single method used to represent a single abstract method that can be implemented by lambda expressions or method references.
156
What does the composite design pattern allow for?
Compose objects into tree-like structure to represent part or whole hierarchies. Now we can work with individual objects and object groups in the same way.
157
What is a thread?
The smallest sequence of programmed instructions that can be managed independently by a scheduler.
158
Why do we use threads?
Efficiency Simpler to write some programs Background processing
159
What are the two ways of creating a thread?
Extend the thread class Implement runnable
160
How do we start a subclass extending thread?
Overriding the method run
161
How do we start a thread implementing runnable?
Override the abstract method run Then use the thread class using it's constructors
162
Why is implementing runnable preferred?
As we can implement many interface but only extend one
163
What are thread properties?
Hints to the tread scheduler to indicate which threads should run first with three constants
164
What does the yield method do?
Causes the executing thread to give up its turns in the round robin and let other thread have processing time
165
What does the interrupt method do?
Interrupts the tread by throwing an exception that has to be handled
166
What states can a thread be in?
NEW: Not started RUNNABLE: executing BLOCKED: Waiting for a monitor lock WAITING: Waiting for another thread TIMED_WAITING: Same as above for a specified time TERMINATED: exited
167
How can we set the names of threads?
Either in the constructor or using setName
168
What does the join function do?
Waits for this thread to die, suspends the execution of the calling thread until a thread has finished execution.
169
What is a daemon thread?
Low-priority thread whose only role is to provide services to other threads. These do not prevent the JVM from exiting once all user threads have finished.
170
How do we create a daemon thread?
By using the setDaemon method before starting.
171
What is the problem with unsynchronised threads?
Two threads can compete to access the same field, one trying to read and another trying to update, who goes first?
172
What is mutual exclusion and how can we have it in programs?
Only one thread at a time executing a certain portion of code, provided through mutex lock.
173
How can we get a mutex lock in Java?
Using the keyword synchronised on a block of code or an entire method.
174
Why should we not surround lots of code in a mutex lock?
As thread easily become blocked waiting for the same block of code. Creating inefficiency.
175
What are the rules of mutex locks?
Always lock during updates to an objects shared fields Always lock during access of possibly updated fields Never lock when invoking methods on other objects
176
What is deadlock?
A thread holds for a lock but is waiting for another lock with is held by another thread that itself is waiting for another lock. And so on...
177
What is the producer-consumer problem?
Producer keeps producing more products and consumer takes them. It is possible that the producer adds the name but not the information to a product and the consumer takes it, receiving the correct name but wrong information.
178
What if (Producer consumer problem) the producer produces more than the consumer can consume?
The producer could overwrite information that hadn't been processed or vice versa if consumer >> producer.
179
How can we solve the two producer consumer problems?
The first one is synchronisation The other is with wait and notify
180
What does the wait method do?
Causes the current thread to wait until it is awakened typically by an interrupt or by being notified.
181
What does the notify method do?
Wakes up a single method that is waiting on this object's monitor
182
What is the difference between notify and notifyAll?
All wakes up every thread that is waiting on the objects monitor.
183
Why do we need wait and notify?
Say two threads are reading and writing to the shared heap to communicate with each order, we can't guarantee execution order and thus can't guarentee which will read first. So wait and notify allow us to have an input in their scheduling.
184
What is a monitor?
A collection of code fragments which are protected by a mutex lock And a queue of threads which have made themselves wait in the monitor.
185
What happens when thread T calls o.wait()
T must be executing within a monitor and within a synchronised block T is blocked T is placed in the queue T releases the mutex lock
186
What happens when T calls o.notify()
T must be executing within a monitor and a synchronised block One arbitrary thread is released from the queue This thread is unblocked, it may not resume execution as it was inside the monitor during execution and doesn't hold the mutex lock. T holds and keeps the mutex lock and continues running.
187
Can we specify a thread to notify?
No, it is notify one arbitrary thread or the notify them all.
188
What is DevOps?
A terms that encompasses tools and practices for developing and maintaining collaborative software projects?
189
What are the 4 areas of DevOps?
Version Control Continuous integration and deployment Repositories Web deployment
190
What is Maven?
A build, project management, dependency management tool
191
Where do I add plugins and dependencies to in Maven?
The POM.xml file
192
What are the three types of execution?
Sequential Concurrent Event Driven.
193
What is event driven programming?
The program is driven by events created by the user
194
What is an (other than GUI) example of event driven programming?
Webservers use EDP to handle incoming requests and send response
195
What is a component?
The static structure of objects
196
What is an event?
An object that correspond to a user action
197
What is a handler?
An object that reacts to events happening
198
What is the stage in JavaFx?
The top-level container or window
199
How can I add action to a button without lambda functions?
Define a class that implements EventHandler Override the handle method Pass an instance to the setOnAction
200
What are the 4 types of nested class?
Static: uses the word static Non-static: defined in another class Local inner: defined within a method Anonymous inner: defined without a name
201
What are the benefits of nested classes?
Logical grouping classes that are used in one place Increased encapsulation More readable and maintainable code Implement UML containment relationships
202
T/F a static nested class can access instance variables
False, only inner nested classes
203
How many times can I use a local inner class within the same method as it is defined?
As many as needed
204
How many times can I use a local inner class outside of the same method as it is defined?
Never
205
Why would we use an anonymous inner class?
They are a throw away instance of some interface, common in HUIs
206
What is the best way to implement comparator?
A static nested class.
207
What are lambdas?
References to methods rather than objects.
208
T/F A lambda expression can define a function?
True
209
Why do we use lambdas?
To hide anonymous class code
210
What is the C equivalent of a lambda?
A function pointer.
211
What symbol represents a lambda?
->
212
What is the method reference operator?
::
213
What are method reference operators used for?
With functional interfaces and lambdas to pass implemented methods rather than create methods on the fly.
214
What are enum types?
A means of modelling a variable with a discrete, finite, number of predefined constant values.
215
Why would we declare static constants for this?
Not typesafe as an integer can take any value, but we wanted 1-5 Brittle Uninformative
216
Is it convention to write enum constant in lower or upper case?
Upper
217
When should we use enum types?
When we have to represent a fixed number of constants.
218
How do enum types work?
They are an anonymous inner class, so a singleton
219
What is the singleton pattern?
Restrict the instantiation of a class to one single instance. They are a form of global variable.
220
What are the benefits of using the enums?
Type safety Clarity Modularity Flexibility
221
T/F You can extend the enum type to add attributes and methods.
True
222
What is var?
A keyword which mimickes languages with weak typing by inferring the type of the object from the right hand side at initialisation.
223
What is the number class?
A built-in wrapper for primitives that allows boxing
224
Why do we prefer to use Number and it subclasses?
To use constants defined by the class To use class methods As an argument of a method that expects an object - Generics
225
What are some of the subclasses of number?
Byte, Double, Float, Integer, Long, and Short
226
Why do we not always use Number?
As it has an overhead which primitives do not.
227
What does the ellipsis operator do?
Allows a variable number of arguments to a method.
228
Can you assign a default value to a parameter?
No
229
What is a property?
A wrapper for Java primitives and Objects
230
What is binding?
A mechanism that allows you to keep two components synchronised using properties
231
How would I set the value of a property?
Either in the constructor or using the set method
232
Why do we use bindings?
Because directly linking components is messy.
233
What happens when a bound property is changed?
It will notify all listeners that it has changed and share the value, automatically.
234
Why do we use bindings and properties?
To decouple the code and encapsulate component operations.
235
What is the observer design pattern?
A component can change subject state decoupled from the observers. A subject holds that case and one or more observers want to be notified when that state changes.
236
Does changing a static variable notify the observers?
No
237
What is a bidirectional binding?
One changes, the other will change as well.
238
What is ChangeListener?
A function interface for responding automatically when the value of an observable changes
239
T/F We cannot create boolean algebra for boolean properties
False
240
What is a timeline?
An animation class that lets you schedule actions to happen over time.
241
How does a timeline work?
By managing a sequence of KeyFrame objects which specify what should happen and when.
242
What does the timeline control of an animation?
Starting, stopping, repeats, and speed
243
What does each KeyFrame require?
A duration, and an eventHandler
244
What is a transition?
A predefined animation that change the properties of nodes over time without manually updating them frame by frame
245
Which file is required for JavaFx styling?
style.css in the resources folder.
246
What code is required to add items from that style.css file?
getClass().getResource("/style.css").toExternalForm()
247
In JavaFx, can I create custom components?
Yes
248
What is Reflection?
The ability of a class or object to examine itself
249
What can we dynamically find out using reflection?
The fields Methods Constructors
250
How does Reflection work?
There is a class object associated with each class that describes the class. Through this you can rediscover the fields and methods.
251
Why don't we use reflection?
Because it destroys any and all encapsulation
252
What is the problem with raw types?
It is completely up to the programmer to use the right type. The problem is detected at run time
253
What are generics?
A means of enforcing type safety without having to define a different class for each type.
254
T/F With the diamond <> operator the type is inferred from the right
False, it is from the left as this is valid ArrayList a = new ArrayList();
255
What are the benefits of generics?
Error detection at compile time No need for casting
256
What are the two strategies for compiling generics?
Code specialisation Code sharing
257
What is code specialisation?
To compile a generic we generate a new representation for every instantiation of a generic type or method At compile time: Form a list of all types of the data structure defined in the code Create a new class of that data structure and compile separately.
258
What is the benefits of code specialisation?
No impact on run time performance Easy to optimise compilations
259
What are the drawbacks of code specialisation?
You need to know at compile time all possible types Creates a bigger executable.
260
What is code sharing?
When compiling generics we generate code for only one representation of a generic type, by erasing the generic type and replacing it with an object. At compile time: All types are stripped from a generic and compiled as a raw type Type checks and casts are automatically added and performed at runtime.
261
What are the benefits of code sharing?
No need to create lots of extra class files which may not be needed
262
What is a model view controller?
A software engineering pattern that separates an application into three interconnected components
263
What are the components of model view controller and what do they represent?
Model: data and logic View: User interface Controller: The interaction between the model and view
264
What is an observable list?
A JFX list that has the property that listeners can be notified of changes.
265
What is a view?
A class that contains all the UI elements of an app
266
What is a controller?
A class that sets up all interaction between the model and view, it attaches everything together.
267
What is a collection?
A group of data structures that represent a group of objects.
268
T/F Collection extends Iterable
True
269
What is the abstract class hierarchy?
From a collection like list you can abstract to an abstract list which implements List and that implements Collections but AbstractList also extends from Abstract collection. Forming a web.
270
What is an array?
A contiguous static data structure where elements are contiguous and thus have random access in memory.
271
Which is faster a HashSet or List for contains()?
HashSet
272
What is a race condition?
Where two or more threads compete for the same shared resource