title: JAVA: How to input a name and get their birthday
body: <p>Mostly need to know why my code stops right before my second <code>for</code> loop.</p>
  <blockquote>
  <p>&quot;Write an application that allows a user to enter the names and birth dates of up to 10 friends. Continue to prompt the user for names and birth-dates until the user enters the sentinel value “ZZZ” for a name or has entered 10 names, whichever comes first.</p>
  <p>When the user is finished entering names, produce a count of how many names were entered, and then display the names. In a loop, continuously ask the user to type one of the names and display the corresponding birth-date or an error message if the name has not been previously entered. The loop continues until the user enters “ZZZ” for a name.&quot;</p>
  </blockquote>
  <p>I've spent hours upon hours on this and feel like i'm getting close but this is due in 4 hours and i really need help. I'm wondering why my program stops before it gets to my second loop. Also wondering if it can be improved. Thank you so very much in advance!</p>
  <pre><code>import java.util.*;
  import java.util.Scanner;
  
  public class BirthdayReminder
  {
      public static void main(String[] args)
      {
          Scanner input = new Scanner(System.in);
          String birth[] = new String[10];
          String names[] = new String[10];
          String a[] = new String[100];
       
          for(int i=0; i&lt;10; i++)
          {
              System.out.println(&quot;Enter name&quot;);
              names[i]= input.nextLine();
  
              if(names[i].equals(&quot;ZZZ&quot;))
              {
                  System.out.println(i); 
                  System.out.println(Arrays.toString(names));           
                  break;
              }
              else if(i==10)
              {
                  System.out.println(i+1);
                  System.out.println(Arrays.toString(names));
                  for(int j=0;j&gt;0;j++)
         
                  break;
              }
              else
              {
                  System.out.println(&quot;Enter Birthday&quot;);
                  birth[i]= input.nextLine();
                  System.out.println(names[i]);
              }
          }
  
      System.out.println(&quot;Enter name to get their Birthday&quot;);
  
      for(int j=0;j&gt;0;j++){
          a[j]= input.nextLine();
  
          for(int k=0; k&lt;10;k++)
              if(a[j]==names[k])
                  System.out.println(birth[k]);
              else
                  System.out.println(&quot;Name not found&quot;);
          }
      }
  }
  </code></pre>