Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

why is it not possible to have a constructor of RationalNumbers class?? It shows error

NischithaNischitha MysoreMember Posts: 3

public class Integers {

public int numerator;
public int denominator;


public Integers(int numerator) {
    this.numerator = numerator;
}

public class RationalNumbers extends Integers {

public RationalNumbers(int numerator, int denominator) {
if(denominator == 1)
super(numerator);

    if (denominator != 0) {
        this.numerator = numerator;
        this.denominator = denominator;
    }
}
Sign In or Register to comment.