We are about to switch to a new forum software. Until then we have removed the registration on this forum.
From my understanding, Abstract Data Type are data types that are described by their functions without actual implementation.
If that is the case, how are Strings, XML and P Vector ADT since they are explicitly implemented.
Also, composite data types, from what I know, are a group of primitive data types without functions, like Struct in C++. The Processing website described String, XML and Arrays as composite data types, how can they be composite data types when they have functions (like String.equals())?
Answers
All non-primitives in Java can be called composite datatypes as well.
B/c at their root they all end up being made outta primitive datatypes if we dig in till the end.
For example the String class, which got 1
char[]
array, plus someint
fields for id & hashing.Its
char[]
array itself stores a fixedint
length ofchar
primitive values.As we can see, once we reach the root of each composite, we end up w/ primitive types only. :-B
BtW, there are 8 primitive datatypes in Java: ~O)
http://docs.Oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html
Also, there are no structs in Java. Only classes & interfaces. [-X
Structs can only have fields as their members.
While classes can have fields and/or methods as well. Plus constructors. :-bd
abstract
as an adjective for datatypes is foreign in Java.abstract
; which means it can have methods which still need to be implemented later, just like most interface's methods.abstract
class don't cause their corresponding datatype name being calledabstract
as well. :-\"Good read!