Hi, im new to Java but am ambitious to learn it. I have a slight problem with my code,
public class Fraction1 { // ============================================================ // Instance variables // ============================================================ /** * The numerator of the fraction. */ private int numerator; /** * The denominator of the fraction. */ private int denominator; // ============================================================ // Constructors // ============================================================ /** * Constructor which takes coefficients explicity. * * Behaviour: Constructs a fraction with the specified numerator and * denominator. Remember that your fraction should *always* be * stored in irreducible form. * * @param num The numerator * @param denom The denominator */ public Fraction1(int num, int denom); // Fill in this method private static void main(String[] args) { System.out.println("Enter numerator"); System.out.println("Enter demoninator"); } }
The error i get is 'missing method body or declare abstract', so after a little googl'ing i thought i'd removed the semi colon afer 'public Fraction1(int num, int denom);' but this gives me more errors, such as 'error ';' expected' and it expects a semi colon after the same line i just removed it from
x