I am currently studying about this ADT but I don't get the concept at all. Can someone please explain to me what this actually is?? Also what is collection, bag, and List ADT?? in simple terms? Thanks
What is ADT? (Abstract Data Type)
Collapse
X
-
A group of types and operations upon these types which collectively make up a new type.Originally posted by EquinoXI am currently studying about this ADT but I don't get the concept at all. Can someone please explain to me what this actually is?? Also what is collection, bag, and List ADT?? in simple terms? Thanks -
I think it's a synonym for a class.
"abstract" == "dealing with a subject in its abstract aspects"
"data" == "informatio n in numerical form that can be digitally transmitted or processed"
"type" == Java type
It's a way of combining attributes to represent something meaningful in your software model. If I decide to combine two Strings to create a Name class, I'd say that I'm abstracting that detail in my model and just dealing with a Name. It's easy to see how I might do it a different way and add more detail (e.g. ,salutation, middle name, suffix, etc.). It's all still a Name to me.
Collection, Bag, and List are examples of data structures. (Others are Map, Dictionary, Tree, Set, Queue, Stack, etc.) Any good book on the subject will tell you what the differences are. Worth a read.Comment
-
> Collection, Bag, and List are examples of data
> structures. (Others are Map, Dictionary, Tree, Set,
> Queue, Stack, etc.) Any good book on the subject
> will tell you what the differences are. Worth a read.
All these data structures are abstract data types. What are you abstracting? Your shielding users from the details of how you've implemented the behavior that is characteristic of each type. Users can expect your object to "act like a List" and not worry about how you implemented that behavior.Comment
Comment