I have two questions need to be solved .
the first Question :
A Superclass , the name is FatherClass , a subclass inheritance the super class , please read this code :
class FatherClass <FT> {
}
class SubClass : FatherClass { // Error : Reference to generic type 'MyFatherClass' requires arguments in <...>
}
How to solve it ? please help me , thanks .
the second Question:
please read this code :
class FatherClass <FT>{
FT fatheType ; // Error : Expected declaration
}
FT is a generic type ,
Why the property fatherType have error ? what's Expected declaration ?
You can use this
class SubClass<FT> : FatherClass<FT> {
}
or a specific type of FatherClass
class SubClass : FatherClass<String> {
}
or
class SubClass<ST> : FatherClass<Int> {
}