Results 1 to 4 of 4

Thread: Cleaning Up Java Code

  1. #1
    Join Date
    Feb 2009
    Posts
    391

    Cleaning Up Java Code

    Hey ,, i am programming student. I need some urget help from you all for one of my project.

    Ineed to know how to clean up Java Codes. Could you guys help me out please ? Its urgent

  2. #2
    Join Date
    Oct 2005
    Posts
    2,393

    Re: Cleaning Up Java Code

    Well, here are the steps to clean Java Codes:-

    1. Bring up the sample of code that you wish to clean.

    2. Read the code. Keep a pair of reading glasses handy, because you’re going to be squinting at the screen for hours and hours.

    3. Check the classes and categories used in the code sample. Java publishes a standard system of names in order to keep the code consistent no matter who is writing it.

    4. Watch your syntax. Java has a certain syntax, or order of its elements, that helps determine what a given command or sequence of code does. Correct any deficiencies that you find.

    5. Evaluate the logical statements of the code. This is the nasty part. Run through each logical unit and check for internal consistency.

    6. Eliminate unnecessary spaces. Each logical unit of code is supposed to be separated by spaces. Get rid of space that doesn’t need to be there.

    7. Cross your fingers and test. Most likely outcome: you need to go back through the code and try again.

    Thats it...

  3. #3
    Join Date
    Jan 2008
    Posts
    1,521

    Re: Cleaning Up Java Code

    You can try this:-
    • In Eclipse, there is a nice feature to clean up Java code. First, you can change the Clean Up profile (Window – Preferences) and define, how you want the code should look like.
    • There are interesting clean ups like “Remove unnecessary casts” or to add missing Annotations like “@Override”.
    • After creating your profile, simply right click to the project and choose Source – Clean up.

  4. #4
    Join Date
    Feb 2009
    Posts
    673

    Re: Cleaning Up Java Code

    Carefully consider what changing one bit of the code will do to the rest of the code sample. Serious problems can result if you do not work out the consequences of changing a sequence of code before you do it.

Similar Threads

  1. help me to understand java code (calendar java code) ?
    By so0oma in forum Software Development
    Replies: 2
    Last Post: 10-01-2011, 12:01 AM
  2. help with java code
    By unikshegz in forum Software Development
    Replies: 2
    Last Post: 24-10-2010, 02:47 PM
  3. Use Java code in PHP
    By Gajendra1 in forum Software Development
    Replies: 6
    Last Post: 12-08-2010, 10:18 AM
  4. Code for Exception in Java
    By taher in forum Software Development
    Replies: 4
    Last Post: 15-01-2010, 09:09 PM
  5. JAVA -- updated code
    By Daren in forum Software Development
    Replies: 1
    Last Post: 21-09-2009, 08:22 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,526,740.51577 seconds with 16 queries