I'm new to java learning. Right now learning about list and array list. While studying I've read out that list is nothing but an interface. Which creates an interface between an method and an object.(Correct me if am wrong.)
Secondly, ArrayList is itself is an a class and having own set of methods inside that.
While checking some java codes, found this statement.
List<String> MyList = new ArrayList<String>();
I just got to know further googleing, that if we create a list then we can use all of the methods inside ArrayList class on List we had just created.(Correct me if am wrong)
But am curious to know, cant imagine so that I could understand this statement. Does it mean MyList variable is created of List type and became an attribute of ArrayList Object. Does it make any sense what I said here..? I want to understand what it means and importance of using like this here ..!!