Efficiency of calling other classes 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();
}
Simplify multiple conditions using a switch

Whenever multiple conditions depend only on the value of a single variable,
consider using a switch instead to simplify:

switch (ans) {
    case 1:
        Quadratic.CalcQuad();
        break;
    case 2:
        CompInt.CalcInt();
        break;
    default:
        System.out.println("That was not an option.");
}


Naming

The common convention is to use camelCase for function names.
The method names CalcQuad and CalcInt violate that.

It also seems that the class names could be better.
If you spell out their purpose, the names won't be much longer but a lot more intuitive and unambiguous, for example:


Quadratic -> QuadraticCalculator
CompInt -> CompoundInterestCalculator


And then the methods that do the calculation can be simply calculate in both classes, without including the type of calculation, which is already included in the class name.

Alternatively, you could use a single Calculator class with calculateQuadratic and calculateCompoundInterest methods.