Writing Obfuscated Code Using Java Generics Part 1 Obfuscated iscritto utilizzando il codice Java Generics Parte 1
Let’s begin with a simple example for this installment. Let's iniziare con un semplice esempio di questo rata.
import java.util.Collection; public class TestType { public static importazione java.util.Collection; classe pubblica TestType (public staticCollection myMethod(Collection a) { return a; } public static void main(String … args) { System.out.println(myMethod("Hello World")); } } Raccolta myMethod (Collezione a) (return a;) public static void main (String… args) (System.out.println (myMethod ( "Ciao Mondo"));))
Note: Nota:
1. The import statement is obviously not required. La dichiarazione di importazione, ovviamente, non è obbligatorio. It has been added for effect. E 'stato aggiunto per effetto.
2. Yes, this code compiles and runs. Sì, questo codice compila e gira.
What we can learn from this simple example: Che cosa possiamo imparare da questo semplice esempio:
1. Yes, you can use any valid identifier as a type name; no need to stick to bland Sun prescribed T, K & V Sì, è possibile utilizzare qualsiasi identificatore valido come un tipo di nome, senza necessità di attenersi a dom blando prescritto T, K & V
2. DO NOT use an existing class name as type identifier. Non utilizzare un nome di classe già esistenti come tipo di identificazione. It can seriously obfuscate your code. Si può seriamente obfuscate il tuo codice.
Filed under Elencato sotto Headline News Headline News , How To Come , Java Software Software Java , Tech Note Nota tech | |
| |
RSS 2.0 RSS 2,0 | |
Trackback this Article | questo articolo |
Email this Article Invia questo articolo
You may also like to read Si può anche leggere come |




