After much trial and error, I finally came up with this code to call on other classes to perform their function. This code works and does what I want it to do, so I am looking for some comments on the code efficiency.
What I want to happen is have the user input which calculator they would like to use and have that calculator come up presenting its own variables and calculations. The code for the calculators works just fine, so I don't need help with that. Just the efficiency of my calling from other classes.
My first iteration of this was to have the other calculators inside methods within the class. When I tried to call them up, it was nothing but problems, but this way seems to work. (I only mention this because my last question got knocked out because the code didn't work, so I found a way that worked, albeit not how I intended.)
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter 1 for Quadratic Calculator");
System.out.println("Enter 2 for Compound Interest Calculator");
int ans = sc.nextInt();
if (ans == 1) {
Quadratic.CalcQuad();
} else if (ans == 2){
CompInt.CalcInt();
} else {
System.out.println("That was not an option.");
}
sc.close();
}