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

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)

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

Howdy, Stranger!

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