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
Presentation software is the best file type for writing a research paper. <br> True <br> False
Vedmedyk [2.9K]

Answer:

False

Explanation:

Document templates such as Google Docs or Microsoft Word are most appropriate.

6 0
3 years ago
Select the correct answer from each drop-down menu.
Lelu [443]

Answer:

First: .Net

Second: New Zealand

Explanation:

Net is short for Network.

NZ means New Zealand.

3 0
3 years ago
Read 2 more answers
There are three types of value for money. Which of the following is not a method of value?
AlladinOne [14]
The answer to this question is c
4 0
3 years ago
A database, a database management system, and the application programs that use the data, make up a database environment.
BlackZzzverrR [31]

Answer:

A) The statement is true

8 0
3 years ago
Durante 10s, la velocidad de rotación y el momento de giro de las ruedas de un coche eléctrico son 100 rpm y 1405,92 Nm, respect
Akimi4 [234]

Answer:

c

Explanation:

hope this helps

6 0
3 years ago
Other questions:
  • [PROGRAMMING] A ____ signal indicates that a specific amount of time should pass before an action starts.
    13·1 answer
  • A forensics workstation consisting of a laptop computer with almost as many bays and peripherals as a stationary workstation is
    10·1 answer
  • Find some search engine as many that you can find
    9·1 answer
  • Differences between Quality of Services and a Service of Quality approach
    9·1 answer
  • What does that program print out?<br><br> a) 2<br> b) 3<br> c) 4<br> d) 8
    14·2 answers
  • Create a datafile called superheroes.dat using any text-based editor, and enter at least three records storing superheroes’ name
    9·1 answer
  • How does Shakespeare immediately introduce Tybalt as a menacing character?
    9·1 answer
  • ____ Is an Internet service that allows users to send and receive short text messages In real time.
    10·1 answer
  • Given positive integer n, write a for loop that outputs the even numbers from n down to 0. If n is odd, start with the next lowe
    8·1 answer
  • This is an example of what type of formula? =average(d1:d17) question 1 options: addition subtraction range average
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!