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

Thread: Codes skip some lines??

  1. #1
    Member
    Join Date
    Mar 2011
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Codes skip some lines??

     					case '1':
      						String[] tempNames=new String [30];
     
      						System.out.println("Please enter filename:");
    						fileName= input.next();
    						custTemp=custData.readFile(fileName);
    						for(int i=0; i<custTemp.length;i++)
    						{
     
    							if(custTemp[i].get_name()!=null)
    							{
    								tempNames[i]=custTemp[i].get_name();	
    								custTxt.add(custTemp[i]);
    							}							
     
     
     
    						}
     
    						Arrays.sort(tempNames);
    						System.out.println("Here");
     
    break;

    after the codes execute the for loop it immediately jump to the break without executing the println statement and the Arrays.sort()


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Codes skip some lines??

    If you want help with code, you'll have to provide an SSCCE that demonstrates the behavior you're talking about.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Please Help What's Wrong with my Codes!
    By bertzki10 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: February 25th, 2011, 11:03 AM
  2. How would you get a JTextArea to know how many lines it had?
    By javapenguin in forum What's Wrong With My Code?
    Replies: 1
    Last Post: January 20th, 2011, 07:58 PM
  3. help with text format codes
    By vanchan09 in forum Java Theory & Questions
    Replies: 1
    Last Post: November 15th, 2009, 04:12 PM
  4. Urgent Help needed with java codes
    By makarov in forum Java Theory & Questions
    Replies: 0
    Last Post: November 13th, 2009, 07:23 AM
  5. help us in eclipse basic codes
    By bil_Imma in forum AWT / Java Swing
    Replies: 1
    Last Post: January 24th, 2009, 06:02 PM