Actually, I'm trying to write a program that discriminates you with a three-dimensional equation with three variables. But when I try to create an object in which the B and C values of my class are, then it says that I have not created the object. Besides, I'm new, so if I did something wrong, then forgive me.
I get this error.
Exception in thread "main" java.lang.RuntimeException: uncompilable source code - flawed tree type: quadratic.equation.solver.QuadraticEquationSolver. Main (Quadricative Aquaculture Solar. Java) Result: 1
Below is the code.
/ * * To change this template, select the device. Templates * and open the template in the editor. * / Package Quadratial. Affix. Solar; / ** * * @Ather User * / Public Class QuadraticEquationSolver {/ ** * @ Param command line argument * / Public static zero main (string [] args) {class square {int aValue; Int bivalue; Int cValue; Public quadatic (int a, int b, int c) {av = a; Beveval = b; CValue = C; } Calculate Public Entry Distributor (int a, int b, int c) {int ace = ((bewewe * bevel) + (- 4 * aw * c valley)); Answer to return; } Quadrilateral first choice = new square (7, 5, 3); } System.out.println (formerly QuadDelicatedDCurrent); }
This is a more obvious solution.
Public Class Quadatic {Private EntWeek; Private life bewewel; Private Actuals; // Constructor public quadratic (int a, int b, int c) {avices = a; Beveval = b; CValue = c; } Public int calculationDiscriminant () {int answer = ((bValue * bValue) + (- 4 * aValue * cValue)); Answer to return; }} // and class and now a test class.
public class test {/ ** * @ ultimate command line argument * public static zero main (string [] args) {quadratic firstquad = new square (7, 5, 3); Println (firstQuad.calculateDiscriminant ()); Public}}} Public static in calculateQuadraticDiscriminant (int aValue, int bValue, int cValue) {/ code> or simply
public final class MathUtil {Private Math}} {} Return (bValue * bValue) + (- 4 * aqua * cValue)); }}
No comments:
Post a Comment