Döngüler, bir işlemin belli bir koşul altında tekrar edilmesi için kullanılır. For döngüsü, java programlama dilinde sıklıkla kullanılan döngülerden birisidir.
Java programlama dilinde:
- For Döngüsü
- While Döngüsü
- Do-While Döngüsü
olmak üzere 3 farklı döngü çeşidi vardır. Bu bölümde for döngülerini inceleyeceğiz. Diğer döngü çeşitleri için Java Dili While ve Do-While Döngüleri sayfasını ziyaret edebilirsiniz.
FOR DÖNGÜSÜ
For döngüsü, en çok kullanılan döngülerden birisidir. Bir koşula bağlı olarak, belirli bir sayıda ve bir koşul sağlandığı süre boyunca tekrarlanan döngüdür.
Bu dersimizde temel for döngüsünü inceleyeceğiz. Birde Java 5.0 sıfır ile gelen enhanced for loop dediğimiz gelişmiş for döngüsü vardır. Diğer dillerde genellikle foreach döngüsü olarak adlandırılırlar. Bu döngüleri Java Dili Arraylist bölümünde anlatacağım.
Şimdi temel bir for döngüsünün genel yapısını inceleyelim.
for(sayac; kosul; sayac artısı)
{
komut1;
komut2;
..
..
}
Sayaç: Adından da anlaşıldığı üzere döngünün kaç defa çalıştığını gösterir. Sayaç daha önceden de tanımlanabilir.
int i = 0;
for(; i < 10; i++)
{
komut1;
komut2;
...
...
}
Yukarıdaki ‘i’ değişkenini yani sayacı tanımladığımız için for döngüsünün içindeki sayaç kısmını boş bırakıyoruz.
Koşul: Döngünün koşulunu kontrol eder ve koşul sağlandığı sürece döngü çalışmaya devam eder.
Sayaç artışı: Bu bölümde ise sayacın artışını veya azalışını belirleriz. Arttırma ve azaltma işlemlerin detaylı anlatımı için Java Dili Operatörler sayfasında arttırma ve azaltma operatörlerini inceleyebilirsiniz.
Şimdi de for döngüsünü kullanarak basit bir örnek yapalım.
package kodbloklari.com;
public class fordongusu {
public static void main(String[] args) {
for(int i = 0; i < 10; i++)
{
System.out.println("KOD BLOKLARI");
}
}
}
Programın içerisinde bir yazıyı 10 defa yazdırmak istiyorsak, bunun için 10 defa System.out.println() metotudunu kullanmamıza gerek yok. Yukarıdaki kodda da gördüğünüz gibi bunu 2 satırlık basit bir for döngüsü ile gerçekleştirebiliriz.
Yukarıdaki kod kısmında önce sayacı tanımladık ve 0′ dan başlattık. Daha sonra program koşul sağlandığı için devam etti, değeri 1 arttırıldı ve döngünün içerisindeki komutu çalıştırdı. Sonrasında şart sağlanmadığı ( i = 10) süreye kadar döngü devam etti. Böylece döngü 10 defa çalışmış oldu.
Kodun ekran çıktısı şu şekildedir:

For döngüsünün en basit hali bu şekildedir.
FOR Döngüsüyle Faktöriyel Hesabı
Şimdi de For döngüsünü kullanarak faktöriyel hesaplayan bir program yazalım.
Faktöriyel: 1’den kendisine kadar olan sayıların çarpımına denir. ( 5! = 5.4.3.2.1)
Programın kodu aşağıdaki gibidir:
package kodbloklari.com;
import java.util.Scanner;
public class faktoriyel {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int faktoriyel = 1;
int sayi;
System.out.print("Bir sayı giriniz: ");
sayi = scan.nextInt();
for(int i = 1; i <= sayi; i++)
{
faktoriyel *= i;
//System.out.println(i + "! = " + faktoriyel); // girilen sayıyı kadar olan faktoriyel
}
System.out.println(sayi + "! = " + faktoriyel);
}
}
Burada döngü değişkenini 1’den başlatıp girdiğimiz sayıya kadar döndüreceğiz. Döngü her döndüğünde elde ettiğimiz sayıyı çarpacağız.
Girilen sayıya kadar olan tüm sayıların faktöriyelini versin istiyorsanız 19.satırdaki açıklama satırını kaldırabilirsiniz.
Kodun ekran çıktısı şu şekildedir:

For döngüsünü kullanarak çok fazla örnek yapabiliriz. Konuyu örnekler yaparak daha iyi kavramak için Java Dili Örnekleri sayfasını inceleyebilirsiniz.
102 Yorum
Thanks for sharing excellent informations. Your web-site is very cool. I’m impressed by the details that you?¦ve on this web site. It reveals how nicely you understand this subject. Bookmarked this web page, will come back for extra articles. You, my friend, ROCK! I found simply the info I already searched all over the place and just could not come across. What an ideal web-site.
Major thanks for the blog. Much obliged.
buy fenofibrate cheap where can i buy tricor oral fenofibrate
tadalafil 5mg pill sildenafil 50mg without prescription purchase viagra sale
zaditor order purchase sinequan imipramine 75mg pill
purchase minoxytop solution purchase cialis online cheap new ed drugs
Thank you, I have just been searching for information approximately this subject for a long time and yours is the best I’ve found out till now. However, what concerning the bottom line? Are you certain concerning the supply?
Ahsoka Tano, introduced to fans through the beloved Star Wars animated series “Star Wars: The Clone Wars,” left the Jedi Order at the end of the show’s fifth season. Her journey continued in the follow-up series “Star Wars Rebels” and in other expanded universe media. However, it was in the pages of the “Ahsoka” novel by E.K. Johnston that the story of her white lightsabers was first touched upon.
buy precose generic buy acarbose 50mg sale griseofulvin ca
aspirin over the counter buy levofloxacin sale imiquimod for sale online
you’re really a good webmaster. The site loading speed is amazing. It seems that you are doing any unique trick. Furthermore, The contents are masterwork. you’ve done a fantastic job on this topic!
melatonin 3 mg us purchase norethindrone sale danazol 100 mg uk
dipyridamole cost brand dipyridamole 25mg pravachol order
buy dydrogesterone 10 mg online order jardiance online cheap order jardiance 10mg online cheap
etodolac 600mg drug brand monograph 600mg pletal generic
Mac Pro Tricks is an integrated news site covering all the news from all over the world, with a new vision that covers all the news as it happens from our different sources.
Crucible Institute – Arab Breaking News
fludrocortisone 100mcg uk cost loperamide 2mg imodium for sale
prasugrel pills cost tolterodine 1mg purchase detrol online
pyridostigmine tablet rizatriptan 5mg ca maxalt 5mg pills
buy cheap ferrous actonel order betapace 40mg uk
xalatan medication buy xalatan no prescription buy rivastigmine 6mg
vasotec tablet lactulose uk buy duphalac bottles
Absolutely! Finding info portals in the UK can be awesome, but there are numerous resources accessible to help you espy the perfect identical for the sake of you. As I mentioned in advance, conducting an online search with a view https://thewheelmedics.co.uk/wp-content/pgs/how-old-is-linsey-davis-abc-news.html “UK news websites” or “British intelligence portals” is a great starting point. Not only purposefulness this give you a encyclopaedic shopping list of report websites, but it intention also afford you with a improved pact of the current communication landscape in the UK.
On one occasion you obtain a file of imminent news portals, it’s critical to evaluate each anyone to shape which upper-class suits your preferences. As an example, BBC News is known in place of its objective reporting of information stories, while The Keeper is known representing its in-depth criticism of bureaucratic and social issues. The Independent is known for its investigative journalism, while The Times is known in search its affair and finance coverage. Not later than entente these differences, you can select the information portal that caters to your interests and provides you with the newsflash you want to read.
Additionally, it’s usefulness all in all close by scuttlebutt portals because specific regions within the UK. These portals lay down coverage of events and good copy stories that are akin to the area, which can be firstly accommodating if you’re looking to hang on to up with events in your close by community. In place of occurrence, local communiqu‚ portals in London include the Evening Standard and the Londonist, while Manchester Evening Hearsay and Liverpool Repercussion are hot in the North West.
Overall, there are tons statement portals accessible in the UK, and it’s high-level to do your digging to see the one that suits your needs. By evaluating the unconventional news programme portals based on their coverage, dash, and editorial perspective, you can select the individual that provides you with the most relevant and captivating info stories. Meet luck with your search, and I ambition this bumf helps you come up with the just right news portal inasmuch as you!
international pharmacies that ship to the usa
buy premarin 600 mg online cost premarin 600 mg buy sildenafil 50mg pill
prilosec 10mg ca montelukast generic buy lopressor pills
buy generic tadalafil cialis 20mg over the counter viagra for sale
buy telmisartan generic plaquenil pill order generic molnupiravir 200mg
purchase cenforce generic buy aralen 250mg generic buy chloroquine generic
I can’t believe focusing long enough to research; much less write this kind of article. You’ve outdone yourself with this material without a doubt. It is one of the greatest contents. I feel very grateful that I read this. It is very helpful and very informative and I really learned a lot from it . This is a great article, Given such a great amount of information in it, this kind of articles keeps the client’s enthusiasm for the site, and continue sharing more … write my assignment Thanks for sharing great information. It is nice to read such high-quality content. Thanks for the post
buy provigil 200mg generic buy provigil 200mg deltasone order online
accutane 20mg usa buy amoxicillin 1000mg online cheap order azithromycin 500mg sale
buy generic omnicef online cost prevacid order lansoprazole 15mg pill
azithromycin buy online azipro 250mg usa neurontin 100mg usa
lipitor 10mg price brand albuterol 100mcg buy amlodipine 5mg pill
online casino gambling lasix 40mg oral buy lasix 40mg
play poker online free best no deposit free spins purchase albuterol without prescription
protonix 20mg ca buy phenazopyridine pill order pyridium 200mg for sale
free poker online order generic stromectol 6mg ivermectin 5 mg price
best mexican online pharmacies
online medication
online blackjack free free slot games online buy synthroid pills
reputable online pharmacy
amantadine for sale online buy symmetrel 100mg generic purchase dapsone sale
order clomid generic generic isosorbide cost azathioprine 25mg
medrol 8 mg tablets purchase triamcinolone pills cheap triamcinolone 10mg
buy generic levitra 20mg buy levitra 20mg without prescription order generic tizanidine 2mg
legitimate canadian pharmacies online
dilantin 100 mg for sale buy dilantin without a prescription order oxybutynin 2.5mg without prescription
purchase aceon for sale desloratadine 5mg drug order fexofenadine 120mg online cheap
During the last 5 years, Amatic has gained more visibility on European markets and probably is going to continue doing that in 2021 So why not to transform this soft provider into an exclusive partner of your casino and beat the rivals? And with Softgaming’s “Slots Bundle” service it’s easier than ever! Just book a demo (it will take just a few clicks) and add the top slots from the 20 most popular soft providers into your casino’s portfolio. Fire and Ice slot has new features and designs of classic slot machines with well-thought-out but exact details. Amatic Industries games’ Fire and Ice slot have the gameplay to the intricate details that make for an outstanding casino. The best thing about this slot is the opportunities it gives players to win.
http://www.yiwukorea.com/bbs/board.php?bo_table=free&wr_id=6195
Also valid at Dreams casino | Royal Ace casino | Raging Bull casino 18+ only. Terms Apply, gamble responsibly. 18+ only. Terms Apply, gamble responsibly. RUBYSLOTS gives 30 free spins no deposit for Cubbe Time Travel Adventure to all new players that sign up a new account and Redeem the code CUBEE30 A 100% Sign Up bonus with a max bonus of $1000 and a wagering requirement of 30x(b&d) on Slots and Parlor Games.Code: RUBY100Percentage play-through by game: Having a great time at Ruby Slots Casino and need to make a real money deposit in order to claim another free chip? Then, we recommend this welcome bonus. The RUBY250 coupon code can only be used alongside your first deposit ever at the casino. The player from Finland is experiencing difficulties verifying his account. According to the information provided by the casino, the player breached the rules of bonuses with playing on roulette, which is excluded from bonuses. Hence, we were forced to reject this complaint.
cheap ozobax baclofen 10mg ca buy toradol generic
order generic baclofen 25mg purchase elavil online cheap toradol price
buy generic claritin for sale ramipril cheap dapoxetine pills
buy fosamax 70mg macrodantin 100 mg cost buy furadantin 100 mg sale
buy inderal pills for sale inderal 20mg drug plavix 75mg us
nortriptyline 25mg over the counter order methotrexate 5mg pills buy anacin for sale
where can i buy amaryl purchase cytotec pill purchase etoricoxib without prescription
coumadin 2mg sale coumadin generic order metoclopramide online
pepcid 20mg generic buy cozaar pills for sale purchase prograf pill
buy nexium paypal purchase topamax online cheap topiramate 100mg ca
astelin sale order astelin 10 ml online cheap order avapro 300mg pill
imitrex 25mg pills buy dutasteride pill buy cheap generic dutasteride
allopurinol 300mg without prescription zyloprim 100mg cost buy crestor 10mg for sale
ranitidine 150mg for sale order meloxicam without prescription celebrex over the counter
buspar 5mg canada cordarone 200mg uk cordarone 200mg without prescription
purchase flomax sale zocor for sale online buy simvastatin 20mg online
order motilium generic order coreg 25mg online sumycin 250mg us
buy aldactone online valacyclovir online order finpecia order
pre written essays for sale write my thesis pay for essay
oral fluconazole 100mg buy generic cipro over the counter buy ciprofloxacin 1000mg online
order sildenafil 50mg sale brand sildalis order estrace generic
order flagyl 200mg online metronidazole 400mg without prescription keflex 125mg drug
buy lamotrigine 200mg for sale buy prazosin 1mg generic buy mebendazole generic
cleocin 150mg uk buy clindamycin without prescription blue pill for ed
buy generic nolvadex betahistine 16 mg pill buy rhinocort
tretinoin cream price order avana online order generic stendra
ceftin medication careprost online order buy robaxin 500mg generic
cost tadacip 10mg tadalafil 10mg over the counter indomethacin online
buy trazodone 50mg buy generic desyrel 100mg clindamycin online
where to buy aspirin without a prescription best real money casino poker online play
buy terbinafine 250mg without prescription purchase terbinafine generic live casino slots online
i need help with my essay slot machines gamble poker online
help me write a research paper write a review order cefixime 100mg generic
buy rocaltrol 0.25 mg generic tricor 200mg tablet tricor price
Aajjo Business Solutions Private Limited stands as India’s premier digital marketplace, spearheading innovation and connectivity across diverse industries. Renowned for its cutting-edge solutions Aajjo B2B Platform
seamlessly facilitates business transactions, fostering growth and collaboration. With a commitment to excellence, it has emerged as the foremost choice for businesses seeking a dynamic and efficient marketplace experience.
buy amoxicillin 500mg generic how to buy amoxicillin generic biaxin 250mg
acne treatment recommended by dermatologists trileptal pills order trileptal 600mg generic
ThankYou For Sharing Such An Great Post – Unlock the Power of Premium Content Watch Now
peacocktv.com/tv
buy catapres no prescription antivert drug order spiriva pill
uroxatral 10mg price costco canada cold and sinus percription medicine for stomach cramps
buy minocin 100mg pill minocycline 50mg sale buy requip tablets
strong sleeping pills for sale sleep prescription online online prescription weight loss programs
femara 2.5mg tablet order albenza 400mg generic abilify drug
fda approved smoking cessation products best pills for arthritis pain alphabetical list of pain medications
buy provera 5mg generic order biltricide 600mg online cheap cheap hydrochlorothiazide
best antiviral drugs inhalers for asthma buy online drugs for type two diabetes
buy periactin 4 mg generic brand fluvoxamine 50mg nizoral oral
pictures of fungus on skin buy medication for herpes online blood pressure medications by name
cymbalta 20mg drug cymbalta 20mg pills provigil where to buy
best for ulcers pain and wounds fast best medicine for svt gram negative bacilli uti treatment