Line numbers don't match

Ryan Staff asked 4 weeks ago

This came through a support ticket and it seems like a common enough question that it’s worth posting here.

When a student gets an error message the line number doesn’t always match up. So they’re looking for an error on line 10, but the error isn’t on line 10. In this case it was on line 7.

My guess is you were probably running a simple tested Java method that didn’t include the class wrapper. Since Java needs to be inside a class, ClassCube wraps the method in a class along with anything you’ve set in your settings as default imports. import java.util.*; is the default. The default imports along with the class signature will push the students code down which is why you’re seeing different line numbers. 
Not sure that there’s a good solution, but that at least is an explanation of what’s going on. 

Your Answer