KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > CondTest


1 public class CondTest {
2
3     public static void main(String JavaDoc [] args){
4     
5         CondTest c = new CondTest();
6         c.run(3);
7     }
8
9     public void run(int x){
10         if (x < 10) {
11             System.out.println(x+" is less then 10");
12         }
13         else if (x > 4) {
14             System.out.println(x+" is greater then 4");
15         }
16         else if (x > 0) {
17             System.out.println(x+" is greater then 0");
18         }
19         else if (x < 5) {
20             System.out.println(x+" is less then 5");
21         }
22         else {
23         
24         }
25         
26     }
27 }
28
Popular Tags