Java Collections astrictly the List?

Good afternoon. Please help to understand with a basic question.
In the Java collections astrictly have a List class, which inherit the basic data structures.
All sources I came across says that you cannot create a direct instance of the List class.
However, when working with code, I meet type design
public List<MyDataClass> myMethod(){
return List<MyDataClass>}

And this record gives me the feeling that what I nedavnim.
What a beast for such a List? And if we can create instances of this class? How to manage this?
March 23rd 20 at 18:51
1 answer
March 23rd 20 at 18:53
Solution
Google about the essence and meaning of the PLO.

An object of an abstract class cannot be created. He then abstract that "underdetermined" and suggests that in the descendant classes will be all that is necessary to finish.

A variable of type List can point to any object of a descendant class.

p.s.

What the above in varying degrees, applies to any language that implements the concept of OOP (specific implementation details in different languages may differ slightly, the essence remains the same)
Using ie I get a List abstract data set.
However, if I want to work with this dataset I need to make castes in what is the data type that is a descendant of List?

On the meaning of OOP read a bunch of articles, maybe were not the same, but there was usually a analysis of the basic principles, but such that we can work with asbtract class, put it in the data honestly faced. Maybe you have a link to good article on OOP? Where would be affected to such pieces? - malinda_Hagen commented on March 23rd 20 at 18:56

Using ie I get a List abstract data set.
However, if I want to work with this dataset I need to make castes in what is the data type that is a descendant of List?


You will get a link to a memory, where the stored data object. How they are treated depends on you. If you indicate that there is a List (as in your example), the object can be apply methods that can List (for example, to add or make clear anything to cast is not necessary)

The heirs of the sheet extend and/or override its methods. Accordingly, you can explicitly specify (Google type casting) that you want data for your pointer to work if it's a specific (well, for example ArrayList). The responsibility for what you are trying to use a LinkedList is like an ArrayList is on you. (for instance java Google the of language tool to check what type of data there really)

Maybe you have a link to good article on OOP? Where would be affected to such pieces?


Any textbook on programming languages with the PLO provides an explanation of OOP principles.
In a nutshell, you can read for example here - marisol14 commented on March 23rd 20 at 18:59

Find more questions by tags OOPJava