1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
serg [7]
3 years ago
8

Which of these is a consequnce of removing a method declaration from an interface after it has been implemented?a. There are no

consequences, interfaces can always be modified to remove methods. b. The method definitions would need to be removed from every subclass that implements the interface.c. Code would breakwhenever an interface reference is used to polymorphicaly call the method in an instance of an implementing class
Computers and Technology
1 answer:
user100 [1]3 years ago
8 0

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.

You might be interested in
Can you anyone please help me​
Yuliya22 [10]

Answer:

Option C I think

3 0
2 years ago
100 POINTS
agasfer [191]

Answer:

i'm just a kid ku ku ku ku ku ku ku ku ku ku ku ku

6 0
3 years ago
1.-  POR QUE LOS HUMANOS NOS INTERESAMOS EN ROBOTS CONASPECTO HUMANO?
oksian1 [2.3K]

Answer:

........

Explanation:

s

6 0
3 years ago
List 2 advantages Cryptocurrency have over regular bank transactions
ratelena [41]

Answer:

low transaction fees and speedier processing

Explanation:

5 0
2 years ago
Read 2 more answers
PLEASE HURRY!!<br> Look at the image below
levacccp [35]
Answer is power and base

Explanation: both power and base are number variables
8 0
3 years ago
Other questions:
  • Adam would like to reduce the size of an image that he inserted into a document. He selects the image and chooses the Crop optio
    11·2 answers
  • What is cyberbullying?
    14·2 answers
  • Interest rate risks would be most relevant to what purchase?
    7·2 answers
  • Help me out here pleaseeeee
    9·2 answers
  • Where (what memory location) is the data read from for the following code:
    12·1 answer
  • Que es un programa de ordenador?
    10·1 answer
  • Describe the importance of human interaction in a computing system.
    14·2 answers
  • The find_item functions uses binary search to recursively locate an item is the list, returning true if found, false otherwise.
    13·1 answer
  • Did you know a security hacker is someone who explores methods for breaching defenses and exploiting weaknesses in a computer sy
    11·2 answers
  • Which of the following tasks are suitable for creating an algorithm? Choose all that apply
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!