Multiple methods and classes will not work!?

When running my code on my own computer, it works perfectly, but I either get a compiler error or wrong answer when I submit to codechef. I have multiple methods inside my main class, and one other class outside of main. Why won’t it work? I code in java by the way.