Write an infinite loop using do while condition.


import java.util.*;

 

public class Solutions {

   public static void main(String args[]) {

      do {

 

      } while(true);

   }   

}



Share to whatsapp

More Questions from Java Basic Codes Module 0

Take an array of Strings input from the user & find the cumulative (combined) length of all those strings.


View

Find the maximum & minimum number in an array of integers.

[HINT : Read about Integer.MIN_VALUE & Integer.MAX_VALUE in Java]


View

Two numbers are entered by the user, x and n. Write a function to find the value of one number raised to the power of another i.e. x^n.


View

Write a function to multiply 2 numbers.


View

For a given matrix of N x M, print its transpose in java.


View

Write a function to calculate the product of 2 numbers.


View

Enter 3 numbers from the user & make a function to print their average.


View