Colorado State University

Recitation R3 - Method Placement
Summer 2016

CS160: Foundations in Programming


Method Placement

Methods create organization. Methods let the programmer approach a small problem and then test that particular problem to make sure the algorithm is correct.
Methods are placed:

Main Method

So does it matter where your main method is placed?
Not neccessarily... But remember, your main method is where your program STARTS executing (sequentially), so you want it to be easy to find.
Conventially, your main method will always be the very first or the very last method in your class.
© 2016 CS160 Colorado State University. All Rights Reserved.