{"id":1040,"date":"2016-06-13T00:34:42","date_gmt":"2016-06-12T21:34:42","guid":{"rendered":"http:\/\/delimuhendis.org\/?p=423"},"modified":"2022-12-20T21:54:26","modified_gmt":"2022-12-20T21:54:26","slug":"java-ile-nyp-ders-5","status":"publish","type":"post","link":"https:\/\/www.delimuhendis.org\/?p=1040","title":{"rendered":"Java Dersleri: D\u00f6ng\u00fcler 3(While)"},"content":{"rendered":"\n<p>Merhaba arkada\u015flar,<\/p>\n\n\n\n<p>Ge\u00e7en derslerde d\u00f6ng\u00fclere giri\u015f yap\u0131p for ve i\u00e7 i\u00e7e for d\u00f6ng\u00fcs\u00fcn\u00fc incelemi\u015ftik. Bu dersimizde ise while d\u00f6ng\u00fcs\u00fcn\u00fc , break-continue ifadelerini irdeleyece\u011fiz.<\/p>\n\n\n\n<p><strong>While d\u00f6ng\u00fcs\u00fc nedir?<\/strong><\/p>\n\n\n\n<p>Hat\u0131rlayaca\u011f\u0131n\u0131z gibi for d\u00f6ng\u00fcs\u00fc i\u00e7in bir i\u015fin belirli bir say\u0131da yap\u0131lmas\u0131n\u0131 istiyorsak kullanmal\u0131y\u0131z demi\u015ftik. While d\u00f6ng\u00fcs\u00fc i\u00e7inde &#8220;o i\u015fin bir ko\u015ful sa\u011fland\u0131\u011f\u0131 s\u00fcrece yap\u0131lmas\u0131n\u0131 istiyorsak kullanmal\u0131y\u0131z&#8221; diyebiliriz.<\/p>\n\n\n\n<p><em><strong>while(SaglanacakKosul)<\/strong><\/em><\/p>\n\n\n\n<p><em><strong>{<\/strong><\/em><br><em><strong>&nbsp; &nbsp; &nbsp; &nbsp;\/\/ Yap\u0131lacak \u015eeyler<\/strong><\/em><br><em><strong>}<\/strong><\/em><\/p>\n\n\n\n<p><strong>Break<\/strong><\/p>\n\n\n\n<p>Break d\u00f6ng\u00fc&#8217;de kullan\u0131ld\u0131\u011f\u0131 zaman hangi durumda olunursa olunsun d\u00f6ng\u00fcden \u00e7\u0131kar.<\/p>\n\n\n\n<p><strong><em>int yas=0;<\/em><\/strong><br><strong><em>while(yes&lt;10)<\/em><\/strong><\/p>\n\n\n\n<p><strong><em>{<\/em><\/strong><\/p>\n\n\n\n<p><strong><em>&nbsp; &nbsp; yas++;<\/em><\/strong><\/p>\n\n\n\n<p><strong><em>&nbsp; &nbsp; if(yas==5)<\/em><\/strong><\/p>\n\n\n\n<p><strong><em>&nbsp; &nbsp; {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/em><\/strong><br><strong><em>&nbsp; &nbsp; &nbsp; &nbsp;break;<\/em><\/strong><br><strong><em>&nbsp; }<\/em><\/strong><\/p>\n\n\n\n<p><strong><em>&nbsp; &nbsp; System.out.print(yas+&#8221;,&#8221;);<\/em><\/strong><\/p>\n\n\n\n<p><strong><em>}<\/em><\/strong><\/p>\n\n\n\n<p>E\u011fer d\u00f6ng\u00fcde break kullanmasayd\u0131k, ekran \u00e7\u0131kt\u0131s\u0131 <strong>1,2,3,4,5,6,7,8,9<\/strong> &nbsp;olacakt\u0131 ancak \u015fimdi <strong>1,2,3,4<\/strong> olacakt\u0131r. \u00c7\u00fcnk\u00fc say\u0131 5&#8217;e geldi\u011finde break komutu \u00e7al\u0131\u015ft\u0131r\u0131lacak ve d\u00f6ng\u00fcden \u00e7\u0131kacakt\u0131r.<\/p>\n\n\n\n<p><strong>Continue<\/strong><\/p>\n\n\n\n<p>Ayn\u0131 \u00f6rne\u011fi continue ile yapacak olursak ekran \u00e7\u0131kt\u0131s\u0131 <strong>1,2,3,4<\/strong> yerine <strong>1,2,3,4,6,7,8,9<\/strong> olacakt\u0131r. \u00c7\u00fcnk\u00fc continue d\u00f6ng\u00fcden \u00e7\u0131karmaz sadece o sat\u0131rdan sonraki sat\u0131rlar\u0131 atlay\u0131p sonraki i\u015fleme ge\u00e7er.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Merhaba arkada\u015flar, Ge\u00e7en derslerde d\u00f6ng\u00fclere giri\u015f yap\u0131p for ve i\u00e7 i\u00e7e for d\u00f6ng\u00fcs\u00fcn\u00fc incelemi\u015ftik. Bu dersimizde ise while d\u00f6ng\u00fcs\u00fcn\u00fc ,&hellip;<\/p>\n","protected":false},"author":1,"featured_media":1390,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[97,133,168,302,614],"class_list":["post-1040","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programlama","tag-break","tag-continue","tag-donguler","tag-java","tag-while"],"_links":{"self":[{"href":"https:\/\/www.delimuhendis.org\/index.php?rest_route=\/wp\/v2\/posts\/1040","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.delimuhendis.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.delimuhendis.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.delimuhendis.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.delimuhendis.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1040"}],"version-history":[{"count":1,"href":"https:\/\/www.delimuhendis.org\/index.php?rest_route=\/wp\/v2\/posts\/1040\/revisions"}],"predecessor-version":[{"id":1424,"href":"https:\/\/www.delimuhendis.org\/index.php?rest_route=\/wp\/v2\/posts\/1040\/revisions\/1424"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.delimuhendis.org\/index.php?rest_route=\/wp\/v2\/media\/1390"}],"wp:attachment":[{"href":"https:\/\/www.delimuhendis.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1040"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.delimuhendis.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1040"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.delimuhendis.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1040"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}