Check out example codes for "java while loop example". It will help you in understanding the concepts better.

Code Example 1

int i = 0;
while (i < 5) {
  System.out.println(i);
  i++;
}

Code Example 2

int i = 0;
while (i < 5) {
  System.out.println(i);
  i++;
}

Learn ReactJs, React Native from akashmittal.com