Rahul Mehta

Greenhorn
+ Follow
since Dec 13, 2000
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rahul Mehta


Here goes the question :
what is wrong ,if anything with the folloeing code:
abstract class MyClass implements Interface1,Interface2{
void f(){};
void g(){};
}
interface Interface1{
int VAL_A = 1;
int VAL_B = 2;
void f();
void g();
}
interface Interface2{
int VAL_B = 3;
int VAL_C = 4;
void g();
void h();
}
According to the book , the code should compile without any errors but when I tried to compile it . It gave following error:
g() in MyClass cannot implement g() in Interface1; attempting to assign weaker access privileges; was public
Can anyone explain me the error.
TIA
Rahul