Tuesday, December 22, 2015

Do-While loop:

Do-While loop:
package javaapplication27;

public class DowhileLoop {
    public static void main(String[] args) {
        int n=10;
        do{
            System.out.println("Go"+n);
            n--;
           
        }while(n>0);
    }
}

The output Is :
run:
Go10
Go9
Go8
Go7
Go6
Go5
Go4
Go3
Go2
Go1


Related Posts:

  • Character Extraction Character Extraction: 2)getChars() If you want to extract more than one character at a time,you can use the getChars() method. It has general form… Read More
  • replace() method Modifying a String: replace();     The replace method is used to replace the one character of string.It has the general form:   &nbs… Read More
  • Character Extraction Character Extraction: 1) charAt() charAt() method is used to extract single character from String.Here is a small program to demonstrate chatAt() … Read More
  • Fibonacci Using Recusion method Fibonacci Using Recusion method: package diamond; import static diamond.Fibonacci.fibonacciRecusion; public class FibonacciDemo {     pu… Read More
  • Access Protection in java: Access Protection in java: private     No modifier protected public  Same class … Read More

0 comments:

Post a Comment