About the meaning of type variables, E, T, etc. used in generics used in Java

E and T are used as Java generics type variables, but I was wondering what the difference between these alphabets was.

In conclusion, the type variable name is also a variable name, so unless you use reserved words, the syntactic meaning does not change.

However, it is good that the variable name is easy for humans to understand and the meaning can be guessed, so it is written according to what type the type actually assigned represents.

For example, E is element and the type variable of the element of the array, T is type and there is no strict specification.

When deciding on a normal variable, do it in the same way as making it easier to guess the meaning later. Nari that decides the type variable so that you can see what type it represents when you look back at it later

Recommended Posts

About the meaning of type variables, E, T, etc. used in generics used in Java
About the idea of anonymous classes in Java
About var used in Java (Local Variable Type)
[Java] Let's declare variables used in the loop in the loop [Variables in the block]
Get the result of POST in Java
[Java] Introducing the Generics Boundary Wildcard Type
[Basic knowledge of Java] About type conversion
The story of writing Java in Emacs
Be careful about upgrade if you use | etc. in the URL of Tomcat
The story of low-level string comparison in Java
[Java] Handling of JavaBeans in the method chain
About the description order of Java system properties
A story about the JDK in the Java 11 era
The intersection type introduced in Java 10 is amazing (?)
The story of learning Java in the first programming
Measure the size of a folder in Java
Feel the passage of time even in Java
Organized memo in the head (Java --Data type)
Import files of the same hierarchy in Java
Get the URL of the HTTP redirect destination in Java
Talking about the merits of database bind variables ((1) Introduction)
About the problem of deadlock in parallel processing in gem'sprockets' 4.0
Source used to get the redirect source URL in Java
Java getClass () is incompatible with generics (or type variables)
[Java] Get the file in the jar regardless of the environment
[Java] Things to note about type inference extended in Java 10
Personal summary of the guys often used in JUnit 4
Change the storage quality of JPEG images in Java
Think about the JAVA = JAVAscript problem (needed in the future)
About full-width ⇔ half-width conversion of character strings in Java
Summarize the additional elements of the Optional class in Java 9
[Java] About enum type
Was done in the base year of the Java calendar week
Learn about the spec while shortening FizzBuzz written in Java
A quick explanation of the five types of static in Java
[Java] "T" is included in date type JSON in API response
[Java] To know the type information of type parameters at runtime
About the operation of Java reading party BOF-held monthly since 1998
Count the number of digits after the decimal point in Java
Traps brought about by the default implementation of the Java 8 interface
Think about the differences between functions and methods (in Java)
How to derive the last day of the month in Java
[Java] I thought about the merits and uses of "interface"
When I was worried about static methods in java interface, I arrived in the order of name interpretation