Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
What method would you use to add an element to a Vector?
Think about which method is used for adding elements in collections.
Is a Vector thread-safe?
Consider how Vector handles concurrency.
Is the Vector class synchronized?
Recall the definition of synchronized classes.
Which method is used to access an element by index in a Vector?
Think about how lists typically work.
You have a multi-threaded application where multiple threads need to add names to a list. Describe how you would implement this using Vector.
Consider how vectors handle concurrent additions.
Write a Java code snippet that demonstrates the use of a Vector in a multi-threaded environment.
Look at how you could simultaneously add elements from different threads.
4 more questions in this section. Enroll free to practise them all.
Enroll free