Skip to main content
summaryrefslogtreecommitdiffstats
blob: db07ddac8fd6d1dca7bd6d8efd2f979de20b343c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package p;

class Cell<T> {
	T t;
	public void setT(T t) {
		this.t= t;
	}
	public T getT() {
		return t;
	}
}

class CellTest {
	public static void main(String[] args) {
		Cell c1= new Cell();
		c1.setT(17);
		c1.setT(17.3f);
		Number n= (Number) c1.getT();
		
		Cell c2= null;
		c2.setT(18);
		Cell c3= new Cell();
		c3.setT(new Long(23));
		c2= c3;
	}
}

Back to the top