Results 1 to 2 of 2
Like Tree2Likes
  • 2 Post By Fubarable

Thread: What is the standard for the composition of methods in a class?

  1. #1
    EscSequenceAlpha is offline Senior Member
    Join Date
    Apr 2012
    Posts
    115
    Rep Power
    0

    Default What is the standard for the composition of methods in a class?

    I know to put the constructor first (increasing parameters) and the main method last, apart form that since my programs were never that big I've positioned my methods more or less arbitrarily. I've been tought many standards and conventions from my books but nothing on this.

    should I make it alphabetical with the excepton of getters/setters that are grouped before the main? because I was heading that way for some reason

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default Re: What is the standard for the composition of methods in a class?

    Quote Originally Posted by EscSequenceAlpha View Post
    I know to put the constructor first (increasing parameters) and the main method last, apart form that since my programs were never that big I've positioned my methods more or less arbitrarily. I've been tought many standards and conventions from my books but nothing on this.

    should I make it alphabetical with the excepton of getters/setters that are grouped before the main? because I was heading that way for some reason
    This is not a dumb question, not at all, and I'm not sure if there is any one universally agreed upon standard, but you can't go wrong reviewing what Oracle has to say on this at their standards document site:


Similar Threads

  1. A class calling methods from external class
    By Aaron5466 in forum New To Java
    Replies: 4
    Last Post: 04-16-2012, 11:36 AM
  2. Replies: 15
    Last Post: 02-13-2012, 09:00 PM
  3. Problem using methods from other class
    By higashi in forum New To Java
    Replies: 5
    Last Post: 10-13-2011, 09:35 AM
  4. How can I call abstract class methods from another class
    By srinivas2828 in forum New To Java
    Replies: 13
    Last Post: 03-12-2010, 02:33 PM
  5. Declare methods in a class
    By Adiel224 in forum New To Java
    Replies: 5
    Last Post: 09-19-2008, 10:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •