0
   

Why you put abstract as qualifier to the method that is introduced/presented in the interface and th

 
 
Reply Tue 22 May, 2012 01:03 pm
Why you put abstract as qualifier to the method that is introduced/presented in the interface and then implemented in the some implementing class? But not all methods that are presented in the interface have abstract as a qualifier, have they and why so?

for example:

public interface Varita {
public abstract String kuinkaVaritan();
}
...
(implementing class)
public class Nelio extends GeometricObject implements Varita {
private double sivu;

public Nelio(double sivu) {
this.sivu = sivu;
}

public double getSivu() {
return sivu;
}

public void setSivu(double sivu) {
this.sivu = sivu;
}

public double getArea() { // ala
return sivu*sivu;
}

public double getPerimeter() { // piiri
return 4*sivu;
}

public String kuinkaVaritan( ) {
return "Väritetään siniseksi neliöksi";
}

public String toString() {
return "NELIÖ: " + "sivu "+sivu+" "+super.toString();
}
}
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Question • Score: 0 • Views: 905 • Replies: 0
No top replies

 
 

Related Topics

 
  1. Forums
  2. » Why you put abstract as qualifier to the method that is introduced/presented in the interface and th
Copyright © 2025 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.04 seconds on 05/05/2025 at 10:27:50