Java - Interfaces
Identify the error in this interface declaration:
interface Calculator {
int add(int a, int b) {
return a + b;
}
}interface Calculator {
int add(int a, int b) {
return a + b;
}
}default or static.add has a body but no default or static keyword, causing a syntax error.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions