View RSS Feed

Advanced Java

Advanced Java programming.

  1. Different Java Generic Types

    by , 02-18-2012 at 04:35 PM
    By using Generics, implementation of Box class is done. It is shown in the given code

    Java Code:
    public class Box<T> {
        // T stands for "Type"
        private T t;
        public void add(T t) {
            this.t = t;
        public T get() {
            return t;
    In given Box class replacement takes place with T, of all occurrences objects.

    For referencing ...