I created a Table class based on 2d ArrayList. The constructor of this class is just simplely take in a 2d String ArrayList. Now the requirements of the assignmnet changed a little bit, so that this Table class would be able to handle both String and Int type of ArrayList. I could build up two different constructors, so that one take in String ArrayList, and another one take in Int ArrayList. But the problem is, the instance of this class was initialized as a String ArrayList, thus a Int ArrayList cannot be assigned to it. I tried to initial another instance with Int ArrayList, but NetBean warned me that there is a name clash between those two constructors, they have the same erasure. Anybody knows what does "erasure" means in Java? And I think my method of implementing this task is wrong, is there another way? Take a rest, come back later...
No comments:
Post a Comment