Link to home
Start Free TrialLog in
Avatar of BrianMc1958
BrianMc1958

asked on

Please advise on physical order of Java items

Dear Experts,

Could you folks either tell me directly, or point me to links on the best practices for the physical order of items within a class?

At the moment, I'm trying to place abstract method declarations.  But I'd like to know the whole ball of wax.  I've read that all public methods should come first, for instance.  But should they come before private class variables?  Should your constructor/s always come first?   Etc., etc....

Thanks!
BrianMc1958
SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
sorry - i cant type to save my life today.

When i was learning Java I was told to place all my imports and variable declarations at the top and in groups.  then followed my constructors, public first, then private and last i had my methods at the bottom half of my program.
Avatar of BrianMc1958
BrianMc1958

ASKER

Nice link!
;-)

ellandrd
Thanks for the grade

ellandrd
:-)