Tutorialslot.com

youtube facebook twitter gmail pinterest

While Loop In Java

It is one of the most fundamental looping statement.It continues to execute until the condition in given expression is true.

Syntax:
while(condition)
{
   body of loop statement
}

Example:
class WhileLoop
{
   public static void main(String args[])
  {
   int i=1
  while(i<13)
{
     System.out.println(i);
     i++;
   }
   }
}

Output:
1
2
3
4
5
6
7
8
9
10
11
12



Advertisement Powered By Google Adsense






IF YOU LIKE THIS TUTORIALS PLEASE SHARE

Share on whatsapp

POPULAR TAGS

Java java tutorials learn java java programming tutorial learn java online learning java professionals tutorials Multithreading Generics Object Oriented Language Methods Polymorphism Inheritance