I am unable to compile the below code written, Java always throws an error. Can you please help me out (P.S: I am new to Java, in a learning stage still). If anywhere, i hav
You probably want to read up a little on interfaces. They are one of the strongest aspects of Java and object-oriented design in general.
If you create an interface called "calci," you are creating a contract that any class implementing the interface will implement what you defined in calci. So you may want to rethink how this is designed currently.
To describe how it works, change the interface to only have one method called "perform." Now, in the implementing classes addition, subtraction, multiplication, and division, create a method also called "perform." You can call it almost anything other than "perform," but make it a characteristic that you feel all classes that calci implements or other interfaces that extend calci should guarantee.
Then it will be possible to do:
calci addition = new addition();
addition.perform();
calci multiplication = new multiplication();
multiplication.perform();
etc.
You can use the @Override annotation on the implementing method to make sure that misspellings are caught in your IDE (like Eclipse).