Let’s begin with a simple example for this installment. Nous allons commencer avec un exemple simple pour ce versement.

 import java.util.Collection; public class TestType {   public static java.util.Collection importation; public class TestType (public static  Collection myMethod(Collection a) {     return a;   }   public static void main(String … args) {     System.out.println(myMethod("Hello World"));   } } Collection myMethod (une collection) (return a;) public static void main (String… args) (System.out.println (myMethod ( "Bonjour tout le monde"));)) 

Note:
1. The import statement is obviously not required. La déclaration d'importation n'est évidemment pas nécessaire. It has been added for effect. Il a été ajoutée pour effet.
2. Yes, this code compiles and runs. Oui, ce code se compile et s'exécute.

What we can learn from this simple example: Ce que nous pouvons apprendre de cet exemple simple:
1. Yes, you can use any valid identifier as a type name; no need to stick to bland Sun prescribed T, K & V Oui, vous pouvez utiliser n'importe quel identifiant valide comme un nom du type; pas nécessaire de s'en tenir à Sun fade prescrit T, K & V

2. DO NOT use an existing class name as type identifier. NE PAS utiliser un nom de classe que le type d'identification. It can seriously obfuscate your code. Il peut sérieusement masquer votre code.