Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: When do I need debugger?

  1. #1
    Junior Member
    Join Date
    Jan 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post When do I need debugger?

    Hi everyone,Im a newby here,so happy to find such helpful place!

    I was writing a java programming exercise,I was following the steps from the E-book

    After Ive done every step and was sure there is no syntax problem showing,I started to run the applet

    But it end up like this,which the number kept counting up:Unnamed.jpg

    Then I copied the entire code from the E-book,it runs smoothly without any problem.
    The result should look like this,its a moving pattern,I took screenshot:

    Unnamed4.jpg

    Ive done several time re-typing,checked each code-line over and over,they are indentical Im sure.

    So what should I do when I reach such problem?Do I and how to debug thing like this?

    Thanks so much


  2. #2
    Junior Member
    Join Date
    Jan 2014
    Location
    Saint-Petersburg, Russia
    Posts
    8
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Default Re: When do I need debugger?

    Please paste your code here to get us better understanding about the issue.

  3. #3
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: When do I need debugger?

    A sense of where to look for a problem in your source code when a program is not running correctly comes with the experience of being your own (and other's?) debugger. Debuggers may or may not - may not being more likely - find logic errors caused by typos in code that compiles and runs but doesn't run exactly correctly. A debugger can't look at what's on the screen and determine that the animation isn't happening or isn't correct.

    I good IDE can provide several hints that there may be something amiss in the code by indicating that variables or methods exist but are never used, the use of improper operators, statements that end too early with a misplaced semi-colon, and others.

    As trod suggested, post the code and describe what's wrong with the way it runs, and we'll do our best to point you towards the solution. Sometimes when staring at one's own code a person sees what they want to see, not what's really there, and typos are invisible. Or it's possible that the code is exactly correct and there's some other technical reason why you're not getting the desired results.

  4. #4
    Junior Member
    Join Date
    Jan 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: When do I need debugger?

    I might have run too many time program,eclipse got stuck,

    I closed the eclipse and run again,re-wrote the code as iriginal pattern,then it works!

Similar Threads

  1. Debugger not stopping in interface implementation
    By dalepres in forum Java IDEs
    Replies: 0
    Last Post: December 7th, 2013, 11:25 PM
  2. Why can't I use debugger?
    By Rexshine in forum Java IDEs
    Replies: 0
    Last Post: March 9th, 2013, 06:06 PM
  3. While Loop Confounds JDK's Command Line Debugger (jdb)
    By christerlin in forum Loops & Control Statements
    Replies: 4
    Last Post: August 16th, 2012, 02:10 PM