KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > CastTests


1 import java.util.*;
2 public class CastTests {
3     private Vector myList = new Vector(27);
4     private Vector myCharacterList = new Vector(27);
5
6     public static void main(String JavaDoc [] args) {
7         CastTests ct = new CastTests();
8         ct.run('p', 0.9);
9     }
10
11     private boolean run(char y, double x) {
12         
13         boolean result = false;
14        
15         if (x >= 0.8) {
16             result &= this.myCharacterList.add(new Character JavaDoc(y)) && this.myList.add(new Double JavaDoc(x));
17         }
18         else if (x == 0.3) {
19             result = true;
20         }
21         else if (x < 0.4) {
22             result = true;
23         }
24         return result;
25     }
26 }
27
Popular Tags