Don't try lots of formatting; it doesn't make for easy reading. I don't think you can change the attributes of title code.
You appear to have found the
wrong forum for your question; this forum is for disccussing this website. I shall move you somewhere better. Thank you for providing full details of the
source of that quote
Maybe it would be easier to understand that you have a trivial case of generics there. That looks like a simple data transfer class; you create an object with an instance of a particular type and when you use it later, you will get an object of the same type back. Let's look at an example:-
The fact that the toLowerCase() call compiles shows that the compiler is correctly interpreting your generics. We know that
String is one of a few classes to have an instance toLowerCase() method.
What you have overlooked is that the format of the formal type parameter is not fixed. Should you use a different formal type parameter, that will be interpreted as simply a formal type parameter by the JVM. If you change all the Ts to Es in that code, it will make no difference to how it is used nor to its functionality. Let us try doing some compiling:-
Now, change all the Ts to Es and you get no difference in functionality. Change all the Es to ArrayList and all you are doing is using an incorrect form for the formal type parameter. If you
try the same code with the T changed to ArrayList, you get exactly the same result. Try it. Even though the bytecode might look different:-
The
word ArrayList has nothing to do with the several classes of that name; it is again a placeholder. All you are doing is spelling the T as A‑r‑r‑a‑y‑L‑i‑s‑t. Try running the lines 15‑16 from my earlier code block, and you will see the anInstance field behaves as a String, not some sort of List.
I think you will find out how to make a container that accepts Lists only if you go through the
Java™ Tutorials.