Mize-ze schreef:
> Hello,
>
[quoted text clipped - 10 lines]
> private T value;
> }
Please follow the naming conventions, especially if you post here:
public class Foo<T>
> public static void main (String argv[]){
>
> foo<Integer> = new foo<Integer>(); // That's ok
Are you sure?
> foo = new foo(); // Can't do this now!
Of course not, for the same reason as the line above.
> how can I?
Don’t forget to give your variables names.
> }
> -----------------------------------------------------------------------------------------------------
>
> Thanks
You’re welcome, H.
- --
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
==================
http://aouw.org
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
> Hello,
>
[quoted text clipped - 18 lines]
> }
> -----------------------------------------------------------------------------------------------------
Your example doesn't compile so I surmise it is retyped and contains
numerous typos. I've therefore no way to know what is wrong with your
real code.
public class Foo<T> {
private T var;
public static void main(String[] args) {
Foo<Integer> foo1 = new Foo<Integer>();
Foo foo2 = new Foo();
}
}
Compiles and runs here.