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 5 of 5

Thread: Error In Printing. Perhaps a nesting problem

  1. #1
    Junior Member
    Join Date
    Jun 2011
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Error In Printing. Perhaps a nesting problem

    Hi, I have the following code:


    Problem has been solved now
    Last edited by Pingu00; June 22nd, 2011 at 02:50 PM.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Error In Printing. Perhaps a nesting problem

    Try debugging your code by adding lots of printlns to show the execution flow and the values of variables that control execution flow.

  3. #3
    Junior Member
    Join Date
    Jun 2011
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Error In Printing. Perhaps a nesting problem

    Thanks, I tried this but it didn't help too much. The files were being read in correctly, but I think there may be a problem with the scoping of the second if statement as when I put in a print statement there it did not print.

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Error In Printing. Perhaps a nesting problem

    Sorry, I can not get your code to compile. I get lots of errors:
    /junk8.java:14: incompatible types
    found   : java.util.ArrayList<java.lang.Integer>
    required: List<java.lang.Integer>
    			List<Integer> l = new ArrayList<Integer>();
    			                  ^
    Last edited by Norm; June 22nd, 2011 at 02:23 PM.

  5. #5
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: Error In Printing. Perhaps a nesting problem

    Quote Originally Posted by Pingu00 View Post
    Hi, I have the following code:

    Problem has been solved now
    Please don't delete the content of your first post. It renders this thread useless to anyone who may of had a similar problem.
    In future, just click Thread Tools and mark the thread as Solved.
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

Similar Threads

  1. Problem printing a two dimensional boolean array
    By sallyB in forum What's Wrong With My Code?
    Replies: 10
    Last Post: June 23rd, 2011, 03:56 PM
  2. Strange problem printing Unicode characters
    By sophist42 in forum What's Wrong With My Code?
    Replies: 9
    Last Post: April 29th, 2011, 10:53 AM
  3. Problem with printing out collinear lines!
    By rkrajnov in forum What's Wrong With My Code?
    Replies: 0
    Last Post: February 25th, 2011, 06:32 PM
  4. [SOLVED] Experiencing a run time error, don't know what the problem is
    By scooty199 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: October 3rd, 2010, 10:21 AM
  5. [SOLVED] Printing Array without printing empty elements
    By CarlMartin10 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: April 12th, 2010, 02:41 AM