|
I've done some C++ coding, and in C++, I used "typedef" in order to create classes that had could contain easily changeable types. (For example, I could write: "TreeNodeType someData;" , and then with one typedef statement at the top of the file, could set TreeNodeType to an application-specific type, so that I re-use that class with different applications.)
Since Java does not have typedef, I am wondering how to emulate this functionality. I am hoping someone with experience can please clue me in on how to create similarly robust classes in Java. Perhaps I should create one master parent class with some arbitrary type, and then extend that class, changing the type as appropriate in children classes? |