Basically, I'm trying to write a program that gives you the discriminant of a quadratic equation with three variables. However when I try to create an object that has the a b and c values of my quadratic it says I didn't create the object. Also I'm new, so if I did something obviously wrong forgive me.
This is the Error I get.
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous tree type: at quadratic.equation.solver.QuadraticEquationSolver.main(QuadraticEquationSolver.java:38) Java Result: 1
Below is the code.
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package quadratic.equation.solver;
/**
*
* @author User
*/
public class QuadraticEquationSolver {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
class Quadratic {
int aValue;
int bValue;
int cValue;
public Quadratic(int A, int B, int C) {
aValue = A;
bValue = B;
cValue = C;
}
public int calculateDiscriminant(int A, int B, int C) {
int answer = ((bValue*bValue)+(-4*aValue*cValue));
return answer;
}
Quadratic firstQuad = new Quadratic(7, 5, 3);
}
System.out.println(firstQuad.calculateDiscriminant);
}