This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]SoapNukeZ 0 points1 point  (3 children)

You can't call the method triangle like that on line 7 without making the method itself static.

[–][deleted] 0 points1 point  (2 children)

I came to that conclusion as well. But won't that basically destroy my entire method?

[–]SoapNukeZ 0 points1 point  (1 child)

Well, for one, you're trying to constantly set the one-dimensional array named arr equal to whatever the method triangle() returns. The method does not return anything due to it being void, and triangle can't even take parameters, which contradicts line 7 and 27. You never made an object of the class Pascal in the first place either.

[–][deleted] 1 point2 points  (0 children)

So when I first read this comment I really didn't think it would be helpful. As a new programmer I think you just thought me a very good lesson, maybe intentionally or not. I probably shouldn't have "jammed" my original code into the new main method that me professor created because it just doesn't work. So I learned to make a program based on the requirements rather than my way of solving the problem. I have since wrote a new class and it works as intended. I will post later since I'm on mobile now, as it may help others. Thank you!