Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Help > Generics
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 11 Topic 15880 of 16566
Post > Topic >>

Generics

by "deelBlue" <deel007@[EMAIL PROTECTED] > Mar 13, 2008 at 09:13 PM

Hi ,

I am trying to program a stack with an array, the interesting part of the 
implementation looks  like :

public class Stack<T> {

	T[ ] field;

	Stack(){
		field=new T[10];
	}

}

but I am getting a compiler error by creating the field (new T[10] ).

can some one help me please.
 




 11 Posts in Topic:
Generics
"deelBlue" <  2008-03-13 21:13:18 
Re: Generics
Eric Sosman <Eric.Sosm  2008-03-13 17:13:32 
Re: Generics
Mark Space <markspace@  2008-03-13 22:30:24 
Re: Generics
Jan =?UTF-8?B?VGhvbcOk?=   2008-03-20 14:00:49 
Re: Generics
Mark Space <markspace@  2008-03-20 18:32:05 
Re: Generics
Jan =?UTF-8?B?VGhvbcOk?=   2008-03-28 11:25:34 
Re: Generics
Lew <lew@[EMAIL PROTEC  2008-03-28 08:10:29 
Re: Generics
Jan =?UTF-8?B?VGhvbcOk?=   2008-03-28 13:41:48 
Re: Generics
Roedy Green <see_websi  2008-03-28 12:30:44 
Re: Generics
Mark Space <markspace@  2008-03-28 21:14:46 
Re: Generics
Roedy Green <see_websi  2008-03-14 06:27:03 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 15:53:32 CST 2008.