Perintah Break Java


bBreak
break: digunakan untuk menghentikan proses secara prematur(paksa),break bisa digunakan disemua kondisi perulangan
contoh:
public class pernyataanBreak{
            public static void main(String [] args){
            for(int a=1;a<11;a++){
            if(a==5)
            break;
            System.out.println(a);
                        }
            }
}
Share on Google Plus

About Unknown

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment

0 comments:

Post a Comment