FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GitHub Viewer

package generics; public class GenericClass { private T t; public void add(T t) { this.t=t; } public T get() { return t; } public static void main(String[] args) { GenericClass iObj=new GenericClass(); GenericClass sObj=new GenericClass(); iObj.add(10); sObj.add(" Hello "); System.out.println("Integer value: "+iObj.get()); System.out.println("String value: "+sObj.get()); } }

Back | FazBrowse Home | New Git URL