We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Java Inheritance II
Java Inheritance II
Sort by
recency
|
343 Discussions
|
Please Login in order to post a comment
//Created classes should not be public class Arithmetic { int add(int x, int y) { return x+y; } } class Adder extends Arithmetic{
}
public class Arithmetic{ public int add(int a, int b){ return a+b; } } class Adder extends Arithmetic{
} `
import java.io.; import java.util.; import java.text.; import java.math.; import java.util.regex.*;
//Write your code here class Arithmetic { public int add(int a,int b){ return a+b; } } class Adder extends Arithmetic{
}
public class Solution{ public static void main(String []args){ // Create a new Adder object Adder a = new Adder();
}
class Arithmatic{ public int add(int a,int b){ return a+b; } } class Adder extends Arithmatic{
}
why its not working??