I know this is probably a super simple question but I can't seem to figure it out for the life of me.
As the title states I just want to call the constructor in the Main Method.
class Example{
public static void main (String[] args)
{
//I want to call the constructor in the mpgCalculator class....
}
public class mpgCalculator {
public double compute(double mpg, double sizeOfTank)
{
double mpL = mpg * 4;
double tankSizeL = sizeOfTank * 4;
double kmpL = mpL * 1.6;
double result = kmpL / tankSizeL;
return result;
}
}
}
MpgCalculator). This isn't a language requirement, but it's a universal convention, and it makes reading your code much easier.