简体   繁体   中英

Is my empty "public class xList<E> extends ArrayList<E>" concrete?

I'm struggling to understand what is a concrete class.

Currently I have an empty class as so:

public class xList<E> extends ArrayList<E> {

}

In a different class and using main method i use:

xList list = new xList();

and then add to it using:

list.add("example");

What I am trying to do is create the xList class which will satisfy my class diagram as being concrete by inheriting from ArrayList. using the xList class i can create an list of students (so it has its own list of objects from a student class). The student class consists of id and name with setters and getters.

Is my way of thinking correct or am i going down the wrong route?

Any class that is not abstract is concrete.

Extending ArrayList or any other concrete collections class is usually not the best idea however. Why create your xList class instead of just using ArrayList?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM