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
|
329 Discussions
|
Please Login in order to post a comment
class Arithmetic { public int add(int x,int y){ int z=x+y; return z; } } class Adder extends Arithmetic{ }
hello mowa answer kosam vachava okok blank place lo e code paste chey
class Arithmetic { int add(int a, int b) { return a + b; } }
class Adder extends Arithmetic { // No need to explicitly define the add method in Adder; it is inherited from Arithmetic }
import java.io.; import java.util.;
class Arithmetic { int add(int a, int b) { return a + b; } }
class Adder extends Arithmetic { // No need to explicitly define the add method in Adder; it is inherited from Arithmetic }
public class Solution { public static void main(String[] args) { // Creating an instance of Adder Adder adder = new Adder();
}
**import java.io.; import java.util.;
public class Solution {
} class Arithmetic { public int add(int x , int y){
return x+y;
} } class Adder extends Arithmetic {
}**