Results 1 to 2 of 2
  1. #1
    brocksoffice is offline Member
    Join Date
    Jul 2012
    Posts
    6
    Rep Power
    0

    Default Java - How could I improve this simple OOP application?

    I'm just looking for some feedback. This is my first Java OOP application and I want to make sure I'm doing everything the right way. How could I improve this code?
    Java Code:
    //Brock Lynch July 31, 2012
    //The beginning of the OOPTest class
    public class OOPTest
            {
            // A static main method
            public static void main(String[] args)
            {
                    OOPTest t = new OOPTest();
                    t.Try("Brock");
            }
    // This is a method
    public void Try(String aName)
    {
    while(i < 10)
    {
    System.out.println(i + " " + "Ha ha ha it worked" + " " + aName);
    i++;
    }
    }
    //Instance Fields
    private int i = 0;
    }
    Last edited by JosAH; 08-01-2012 at 09:18 AM. Reason: added [code] ... [/code] tags

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default Re: Java - How could I improve this simple OOP application?

    Indenting your code properly.
    Using naming standards (only the method name is wrong here).

    Other than that there's not enough of a program there to say.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. How can I improve -> Simple JSF Login example
    By buyapentiumjerk in forum Enterprise JavaBeans (EJB)
    Replies: 2
    Last Post: 07-06-2011, 11:42 AM
  2. Replies: 0
    Last Post: 05-13-2011, 03:17 AM
  3. why this simple java application goes into dead lock?
    By jokop in forum Threads and Synchronization
    Replies: 12
    Last Post: 02-04-2011, 08:57 AM
  4. Simple Java application methodology
    By vishantgarg in forum Forum Guides
    Replies: 5
    Last Post: 11-03-2009, 03:32 PM
  5. Converting simple Java Application to Applet
    By jrohde in forum Java Applets
    Replies: 1
    Last Post: 07-25-2009, 07:48 PM

Posting Permissions

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