Tim Bant wrote:Am I right in thinking that:
- Line 22 is a Hashset of String type? So is the equivalent of doing the following?
Tim Bant wrote:- Line 25: How can a linkedList take in a hashset, given that LinkedList is a sub type of List?
Tim Bant wrote:And LinkedList is basically an ArrayList but is quicker to add/remove but slower to read than ArrayList?
No. It is basically a List, but is implemented completely differently from array lists.Tim Bant wrote:. . . And LinkedList is basically an ArrayList but is quicker to add/remove but slower to read than ArrayList?
Thanks!
The only reason I can think of is that you are doing a Data Structures and Algorithms module and they tell you to implement a linked list as an assignment.Mike Simmons wrote:Yeah, it's pretty rare to actually need a LinkedList for anything, nowadays. . .
There are three kinds of actuaries: those who can count, and those who can't.
No; they all perform different functions and behave differently.Tim Bant wrote:. . . Set List and Queue . . . you can mix and match those 3?
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
I wasn't.Mike Simmons wrote:. . . if you're looking at the constructor . . .
You use a List as a List (sometimes also called a Sequence), you use a Set as a Set, and you use a Queue as a Queue. The Java™ Tutorials should explain the differences. Or your course should so do. Yes, there are instances where different types are interchangeable; you can make a Set from a Queue, a Queue from a List, and a List from a Set. Just as you can take all the people on a bus and put them on a ferry, put all the people from a ferry onto a train, or all the people from a train onto a bus (well, a very big bus). But trains aren't buses and buses aren't ferries and ferries aren't trains.. . . even where they are "interchangeable", they may behave differently. . . .
Education won't help those who are proudly and willfully ignorant. They'll literally rather die before changing.
Campbell Ritchie wrote:The earliest OO language was Simula67, which came out in, would you believe, 1967.
Education won't help those who are proudly and willfully ignorant. They'll literally rather die before changing.
Campbell Ritchie wrote:The earliest OO language was Simula67, which came out in, would you believe, 1967.
Campbell Ritchie wrote:
I wasn't.Mike Simmons wrote:. . . if you're looking at the constructor . . .
Simula preceded Smalltalk.Carey Brown wrote:
Campbell Ritchie wrote:The earliest OO language was Simula67, which came out in, would you believe, 1967.
The earliest one I knew of was SmallTalk.
Education won't help those who are proudly and willfully ignorant. They'll literally rather die before changing.
Everybody's invited. Except this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|