class - Trouble accessing variables from different Java classes -
i trying figure out how variable linearequation class main class. have been trying replicate results instructor's notes, hasn't been working. have seen examples close instructor did, mine still doesn't want work.
right goal simple, want declare double = 1
in linear equation class , return main class , output there.
i see couple problems.
(as mentioned @kishorekumarkorada) linearequation constructor expecting multiple arguments
linearequation le = new linearequation(1,2,3,4,5,6);
when call method need include parentheses
system.out.print(le.geta());
your
geta
method should referthis.a
rathera
public double geta() { this.a = 1; return this.a; }
Comments
Post a Comment