That isn't true. OP has declared calcualteAverage() as static, so it's perfectly legal to call it inside main.