2

I just want to know the "absolute" name for the type which is represented by an ArrayList of String (ArrayList<String>).

For exemple, for Integer, the complete name is java.lang.Integer, so what's the equivalent for the ArrayList<String> ?

Thanks

3
  • 1
    java.util.ArrayList Commented Jul 29, 2013 at 8:25
  • 1
    When you have doubts like this check Oracle's documentation. Example: docs.oracle.com/javase/6/docs/api/java/util/ArrayList.html Commented Jul 29, 2013 at 8:26
  • For questions like this, javadoc is your friend. Go to google, in your case, type "Arraylist javado"c. The package where it belongs, class details, and other helpful details are available there. Commented Jul 29, 2013 at 8:55

6 Answers 6

3

For an ArrayList<String> or ArrayList<Integer>, the fully qualified name will be java.util.ArrayList. It won't change based on the type of data the list will hold.

Read up on Type Erasure and Generics for more insight.

Sign up to request clarification or add additional context in comments.

Comments

0

java.lang.String for String and java.util.List for list and java.util.ArrayList for arraylist.

Comments

0

ArrayList.class.getName() gives java.util.ArrayList and similarly for String String.class.getName() gives java.lang.String `

Comments

0

The "absolute" (i.e. fully qualified) name of ArrayList is java.util.ArrayList, but I would say the fully qualified name of ArrayList<String> is:

java.util.ArrayList<java.lang.String>

Comments

0

You can have that kind of "name" for ArrayList<> and String as follows.

 java.util.ArrayList<java.lang.String>

But ArrayList<WHAT_EVER> fully qualified name is java.util.ArrayList

Comments

0

for String:

http://docs.oracle.com/javase/6/docs/api/java/lang/String.html

for ArrayList:

http://docs.oracle.com/javase/6/docs/api/java/util/ArrayList.html

for the future, enter (in google) for example:

string java

or just go to:

http://docs.oracle.com/javase/6/docs/api/

and search what you want.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.