What Is Java loops

what is java loops in hindiDear Students, aaj ke is Lecture me hum What Is Java Loops ke bare main padege. Yani ke Java language mian loops kya hote hai. Java language mian loops kaise kaam karte hai. Types of Java Loops aadi se related ye sare topic ham isi lecture main cover karege.

Lectures Covering Topic

  • Introduction To Java Loops In Hindi
  • Why Use Loops In Java Language In Hindi
  • Advantages Of Loops In Java Language In Hindi
  • How To Makes Java Loops In Hindi
  • Types Of Loops In Java In Hindi
  • Syntax Of Loops In Java Language In Hindi
  • Examples Of Java Loops In Java Language In Hindi

Introduction To Java Loops In Hindi

Java language main kisi block ya program ke kisi code ke eak part ko kai bar execute karna hota hai. Tab ham loops ka use karte hai. Yani ke loops codes ko eak se jayada bar repeat karne ke liye kiya jata hai.

To Java loops aapke code ki eak ya eak se jayda lines ko repeat karne ke liye allow karta hai. Bahut sare programs main ese kaam hote hai jinhe repeat kiya jana chahiye.

Isliye kisi bhi programming lanugae ke liye loop structure bahut important part hai. To chaliye seekhte hai loops in Java Language ke bare main ye Loops kaise kaam karta hai.

Why Use Java Loops In Java Language In Hindi

Why use loops in Java yani ki hum Java language main loops ka use kyon karte hai. Ab aap maan lo ki me aapse kahun ki “hindimetutorial.com” statements ko aapko 15 times print karna hai. To aisa aap kis tarah se karnege?

Generally aisa karne ke liye aap 15 times System.out.println() statements ko likhenge. Ya fir main aapse 2, 3 ka tables pringt karne ke liye kahun. To aap iske liye bhi 10-10 times System.out.println() statements likhenge.

Yah eak wrong process hai aisa karne se programmer ka time or computer ki memory dono he waste hoti hai. Is tarah ke kaam ko karne ke liye hum loops ka use karte hai. Loop main hum yah kaam 4 and 5 lines main complete kar sakte hai.

Advantages Of Java Loops In Java Language In Hindi

  • Loops ke help se hum apne time ko bacha(save) kar sakte hai.
  • Iski helps se hum Array, LinkList ke elements ke sath traversing kar sakte hai.
  • Loops ke help se hum apne bade code ko thoda kam kar sakte hai.

How To Makes Java Loops In Hindi

Jaisa ki aapko mene bataya hai ki loops ka use one more then lines ke code ko print karane ke liye kiya jata hai. To ab aapko ye bhi pata hona chahiye ki loops ko banate kaise hai. Loops 3 parts se milkar bana hota hai.

how to makes java loops in hindi

  • Initial Variable:- Yah wah variable hota hai jhan se hum loop ko start karte hai. Yah eak integer variablehota hai. Is variable ko jab tak increments/decrements kiya jata hai jab tak ki di hui condition false nahi ho jati. Isi variable ko loops main di huyi condition main include kiya jata hai.
  • Condition:-Yah wo condition hoti hai jo loop ko control karti hai. Jab tak yah condition true hoti hai tab tak loop execute hota rahta hai. Jaise he ye condition false hoti hai loop automatic terminate ho jata hai.
  • Increment/Decrement:- Yhan se hum apne loop ko kitne number se ya fir kaise loop ko chalana hai. Apne initial variable ko increment ya decrement karte hai. Yah sab increment part main define kiya jata hai.

Types Of Loops In Java In Hindi

Java language me hamare paas 4 types ke loops hote hai.

  • For loops
  • While loops
  • Do-while loops
  • For Each LoopsTypes of java loops in hindi

For Loops In Java In Hindi

Java loops mian for loop ka use sabs jyada kiya jata hai. Yah loop sabse essy hota hai. For loop eak single statements main define hota hai. Aap iska syntax neeche dekh skate hai. For loop ki yah eak khas bat hai ki iske 3 elements eak he statement me likhe jate hai.

Syntax

While Loops In Java Hindi

While loop bahut he simple loop hota hai. Ye Tab tak execute hota hai jabtak iske condition ture rahti hai. Condition ke false hone par ye loop terminate ho jata hai. While loop ka syntax aap neeche dekh sakte hai.

Syntax

Condition agar pahle bar he false hoti hai. To compiler loop main enter nahi hota hai. Loop ke andar ke sare statements ko skip kar diya jata hai.

Do-While Loop In Java In Hindi

Do-While loop bhi while loop ke tarah he hota hai. Lekin is loop main condition check hone se pahle statement execute hota hai. Eak bar execute hone ke bad condition check hoti hai. But aisa sirf first time hota hai.

Syntax

Jaise ki compiler do section me ata hai. To do block ke sabhi elements ko execute kar diya jata hai. Or initial variable ko increment/decrement kar diya jata hai. Iske bad compiler while condition ke check karta hai. Yadi condition true hoti hai to do block ko execute kiya jata hai. Or agar condition false hoti hai to loop ko terminate kiya jata hai.

Note:- Is lecture main hum sirf loops ke type or syntax ke bare main seekh rahe hai. In loops ko details main hum next lectures main padege.

For-Each Loop In Java In Hindi

For each loop ka use hum tab karte hai jab hame loop kitne bar chalana hai yah pta nahi hota hai. Jab hame loop ko kisi unknown number tak chalna hota hai to hum for each loop ka use karte hai

Syntax

Examples Of Loops In Java Language In Hindi

Aap neeche example ko dekh kar aaasani se loops ke bare main samjh sakte hai. Mene neeche aapko 2 ka table print karke dikhaya hai. Or sath he sath mene for loop ka use karna bhi dikhaya hai. Kiase for loop ke help se aap 10 lines ke code ko sirf 3 lines ke code man change karte hai.

Output

Aap neeche image main dekh sakte hai ki kaise sirf 4 lines ke code se 2 ki table print ho gyai hai. Isme mujhe bas For loop ki help leni padi hai.

Related Lecture

Dear Students, main aasha karta hun ki aapko loops in Java Ka Lecture padh kar samjh me aa gaya hoga. Ki Java language main loop statements ka use kaise karte hai. Yadi aapako is lecture se related koi bhi problem hai to aap hume comment karke puch skte hai.

Share This Post On

About Author

Thakur Aman Singh

Hey, I am Aman Singh Tomar from Taj City Agra. Through This Blog I want to share my Knowledge with all of you. Read More >>

Leave a Reply

Your email address will not be published. Required fields are marked *