habe folgenden code: { try {

            Scanner scan = new Scanner (System.in);

            int d1 = 3;
            int d2 = 5;
Schleife1:
            for (double a=0; a<d1 ;a++)
                {   

                System.out.println("Variable a:");
                String a1 = scan.next();
                a1 = a1.replaceAll("," , ".");


                if(!a1.matches("((-|\\+)?[0-9]+(\\.[0-9]+)?)+"))    

                {

                System.out.println("Nur Zahlen!");
                continue;

                }



                double a2 = Double.parseDouble(a1);


                for (double b=0;b<d2 ;b++)
                    {

                    System.out.println("Variable b:");
                    String b1 = scan.next();
                    b1 = b1.replaceAll("," , ".");

                    if(!b1.matches("((-|\\+)?[0-9]+(\\.[0-9]+)?)+"))

                        {

                        System.out.println("Nur Zahlen!");
                        continue;

                        }

                    double b2 = Double.parseDouble(b1); 




                    double c; 
                    c= max1(a2 , b2);
                    System.out.println(c); 

                    if (c==0)   {
                        System.out.print("Werte gleich");
                        }       

                    if(a1.matches("((-|\\+)?[0-9]+(\\.[0-9]+)?)+") && b1.matches("((-|\\+)?[0-9]+(\\.[0-9]+)?)+"))
                        {
                        break Schleife1;
                        }
                    }

                }

            }

                catch (Exception ex)
                {
                System.out.println("Bitte Zahl eingeben!");
                }

Mein Problem ist das die innere Schleife, wenn d2 erreicht wurde, also nach fünfmaliger eingabe z.b. eines buchstaben, zwar beendet wird, dann allerdings die äußere schleife wieder anfängt. was ich allerding will ist, dass wenn d2 in der inneren schleife erreicht wird, das programm komplett beendet wird.

hilfe bitte!