This Java program defines a class with a main method that declares an integer variable z initialized to 2. It checks if z is less than 10, and if so prints a message. It then enters a while loop printing another message as long as z remains less than 5.
This Java program defines a class with a main method that declares an integer variable z initialized to 2. It checks if z is less than 10, and if so prints a message. It then enters a while loop printing another message as long as z remains less than 5.
Copyright:
Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online from Scribd
This Java program defines a class with a main method that declares an integer variable z initialized to 2. It checks if z is less than 10, and if so prints a message. It then enters a while loop printing another message as long as z remains less than 5.
Copyright:
Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online from Scribd
{ public static void main(String args[]) { int z=2; if(z<10) System.out.printf("There is no problem"); while(z<5) System.out.printf("This is cool"); } }