import java.util.Scanner;
public class Fraction
{
private int numerator;
private int denominator;
private int product;
private int sum;
public Fraction(int num, int denom)
{
this.numerator=num;
this.denominator=denom;
if (this.denominator == 0){
System.out.println("can not divide by zero");
}// end if
}// end fraction
public void print()
{
System.out.println(this.numerator + "/" + this.denominator);
}
public void printAsDouble()
{
System.out.println((double) this.numerator / this.denominator);
}
public mulitply(Fraction)
{
Fraction(x).product = ((( Fraction(c).numerator * Fraction(d).denominator) + (Fraction(d).numerator * Fraction(c).denominator)) / (Fraction(c).denominator * Fraction(d).denominator));
}
}// end class Fractiont
I keep getting the same errors expected and invalide method declaration
Ok i have a new fraction in my main class called x and that is where i was calling the fraction X from. and what does it mean that it needs to return something?