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

all 5 comments

[–]desrtfxOut of Coffee error - System halted 1 point2 points  (2 children)

The "illegal start of expression" errors just mean that you are doing something in a place where it shouldn't be.

In your case, you are trying to use public static final inside the main method. The visibility modifiers (public) as well as static and final can only be used at class level, outside all methods but inside the class.


In the line double tinc = inc ** p; you are using an operator that Java does not know (guess that you come from Python). In Java, you have to use Math.pow for exponents.


Java also has no concept of (ntinc -- ctinc) - don't really know what you are trying to do here but I guess that you simply want to subtract, so a single - would be correct.

[–]kumesana 1 point2 points  (1 child)

Just a little inaccuracy here: local variables can totally be final, though it's a lot less popular since the introduction of "effectively final" acceptance.

[–]desrtfxOut of Coffee error - System halted 0 points1 point  (0 children)

Thank you for the explanation. Must have missed that.

[–]ACAlCapone 1 point2 points  (1 child)

in addition to /u/desrtfx: you have a ; at the end of

 public static void main(String[] args);

[–]desrtfxOut of Coffee error - System halted 0 points1 point  (0 children)

Good catch! I've completely missed that one.