Well it depends, you can do either way really.
If you have a class set up for your fraction code, you could get the input in the main function and then pass it into your fraction object when you create it.
Something like
public class myProg {
public static void main (String[] args) {
float a, b, c, d;
a = console.nextInt();
b = console.nextInt();
c = console.nextInt();
d = console.nextInt();
Fraction frac = new Fraction(a,b,c,d);
}
} And then in your class something like
public class Fraction{
public Fraction(float a, float b, float c, float d){
addFraction(a,b,c,d);
}
}
Or you can put it write into the class. In the end you get the same result.