我不明白为什么下面的代码会产生警告。 interface Generic<T> {
}
interface A {
}
class B {
Generic<A> c;
<T extends A> B(Generic<T> a) {
c = (Generic<A>) a; //warning here
}
}
//Unchecked c
这是在声明时初始化变量的最佳做法。 int TMyClass::GetValue()
{
int vStatus = OK;
// A function returns a value
vStatus = DoSomeThingAndReturnErrorCode();
if(!vStatus)
//Do something
else