1 import java.util.*; 2 3 public class CondAndTest { 4 5 private Vector charsSet = new Vector(); 6 private Vector charsProb = new Vector(); 7 8 public static void main(String [] args) { 9 10 boolean x = true; 11 boolean y = false; 12 13 if (x && y) { 14 System.out.println("Both True"); 15 } 16 17 CondAndTest cdt = new CondAndTest(); 18 cdt.addChar('i', 0.9); 19 } 20 21 private boolean addChar(char c, double d) { 22 boolean result = false; 23 24 if (d >= 0) { 25 result &= this.charsSet.add(new Character (c)) && this.charsProb.add(new Double (d)); 26 } 27 28 return result; 29 } 30 } 31 | Popular Tags |