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]
2 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]2 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
You use the _____ sheet in the format cells dialog box to position data in a cell by centering it, for example.​
Oliga [24]
You use the Alignment sheet in the format cells dialog box to position data in a cell by centering it, for example. Generally along the middle branch is a line or centerline of the definite pipeline on a scale of whatever is indicated.
3 0
2 years ago
Write a program that outputs "Hello World!".
tekilochka [14]
Print(“Hello World!”)

I hope this helps :) I’m sry is this what you wanted or were you looking for something else because I’m willing to help either way.
4 0
2 years ago
The _____, a subcortical brain structure crucially involved in storing new information in memory, is smaller in people with schi
pashok25 [27]

Answer:

The hippocampus, a subcortical brain structure crucially involved in storing new information in memory, is smaller in people with schizophrenia and their first-degree relatives (parents and siblings) than in control participants.

6 0
3 years ago
Gleick believes that the book is
ss7ja [257]

That it is a tool that does its job well, it's a technology that works.

6 0
3 years ago
7.4.4: Length of User's Name
Natalija [7]

Answer:

user_name = input("input user name: ")
print(len(user_name))

Explanation:

input - input function in python

len - length of value

print - print data

6 0
2 years ago
Other questions:
  • Which type of system must you connect to and use to make changes to Active Directory?
    15·1 answer
  • Shelly praised Susan via email for how well she executed an employee training program last week. Shelly is engaging in the _____
    6·1 answer
  • What is the name of the feature that can be enabled on slower-speed WAN links to prevent a large data transfer from affecting th
    10·1 answer
  • A Raycast returns a float that tells you how far away an Object is
    8·1 answer
  • Convert hexadecimal number 1AF2 to a decimal number.
    7·1 answer
  • What part of the meat help you identify the less tender cuts​
    13·1 answer
  • Name the application used for creating Presentations___
    5·2 answers
  • Write the difference between left-sentential form and <br> right-sentential form
    13·1 answer
  • What font family is Times New Roman an what font family is Arial?
    9·2 answers
  • Employers are looking for an employee?<br>​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!