hey i m new in Generic Class in java.
look at this code carefully ....
[code=java]
class GenerericClass< T>
{
private T d1,d2;
public GenericClass()
{
d1 =100;
d2 = 200;
}
}
[/code]
another part of my code ....
[code=java]
GenericClass<St ring> c = new GenericClass<St ring>();
//It will flash a compiler error .....
[/code]
So my conclusion is that having a default constructor in GenericClass is meaningless.
Right????
i think experts allof u get my point .....
so plz explain ......
kind regards,
Dmjpro.
look at this code carefully ....
[code=java]
class GenerericClass< T>
{
private T d1,d2;
public GenericClass()
{
d1 =100;
d2 = 200;
}
}
[/code]
another part of my code ....
[code=java]
GenericClass<St ring> c = new GenericClass<St ring>();
//It will flash a compiler error .....
[/code]
So my conclusion is that having a default constructor in GenericClass is meaningless.
Right????
i think experts allof u get my point .....
so plz explain ......
kind regards,
Dmjpro.
Comment