/Users/lyon/j4p/src/bookExamples/appJBitOps/AndOperations.java

1    package bookExamples.appJBitOps; 
2     
3    /** 
4     * DocJava, Inc. 
5     * http://www.docjava.com 
6     * Programmer: dlyon 
7     * Date: Dec 6, 2004 
8     * Time: 3:17:32 PM 
9     */ 
10   public class AndOperations { 
11       public static void main(String[] args) { 
12           int a = 0x7f; 
13           int b = 0x5f; 
14           int c = a & b; 
15           System.out.println("a="+Integer.toString(a,2)); 
16           System.out.println("b="+Integer.toString(b,2)); 
17           System.out.println("c="+Integer.toString(c,2)); 
18        } 
19   } 
20