0

Why does java.util.Arrays have an inner ArrayList class instead of utilizing java.util.ArrayList even though they are both in the same package?

2
  • 1
    Possible duplicate of Why is there an ArrayList declaration within java.util.Arrays and private static class ArrayList in java.util.Arrays - Why? Commented May 10, 2017 at 16:31
  • Arrays does not have an inner class ArrayList. When I check the source code I find private static class ArrayList<E>, not an inner class. From the JLS: "An inner class is a nested class that is not explicitly or implicitly declared static." "The static keyword may modify the declaration of a member type C within the body of a non-inner class or interface T. Its effect is to declare that C is not an inner class." Commented May 10, 2017 at 17:14

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.