Answer:
Option (a)
Explanation:
It will not produce any error as if a function is declared in the interface and then implemented by a class same function can be defined, but if that declaration is removed then also that class will consider that method as new declaration and it won't produce any type of error. For example : if following code of Java is run -
interface printing{
void print_it();
//method declared
}
class Student implements printing{
public void print_it() //method implemented
{
System.out.println("Hello World");
}
public static void main(String args[]){
Student obj = new Student();
obj.print_it(); //method called
}
}
OUTPUT :
Hello world
But if the program is altered and declaration of print_it is deleted from the interface like following :
interface printing{
//method is removed from here
}
class Student implements printing{
public void print_it() //method implemented
{
System.out.println("Hello World");
}
public static void main(String args[]){
Student obj = new Student();
obj.print_it(); //method called
}
}
Still no error is generated and same output is displayed as before.