Originally posted by Hina Mustafa:
hi,
There's a question from a mock exam..
Consider the following code and select the most appropriate statements.
Public class overL{
public int doubleValue(int a){}
public float doubleValue(int a){}
}
the correct answers given by the exam are
1-The code doesn't compile because the compiler sees two methods with the same signature.
2-The code can be made to compile by redefining the parameter for doubleVal() on line 7 to be "float a" instead of "int a".
I suspect that answer 1 is not correct instead of 'singnature' it should be 'parameter'.
Please someone assure me I'm right.
Thanx
Hina.
Originally posted by Adrian Yan:
This is a theoretical question.
For example, constructors are not inherited by the subclasses. Private members are inherited, you just can't use them.
My question is: do you consider constructors members?
Originally posted by Charley Wu:
The more I read, the more confused I am. I know that wait() is defined in Object, not in Thread. However, as Thread is derived from Object, a thread object should also has a wait() method. Is that right?