home *** CD-ROM | disk | FTP | other *** search
/ Java Certification Exam Guide / McGrawwHill-JavaCertificationExamGuide.iso / pc / Web Links and Code / exer / chap4 / exer0404 / A.java
Encoding:
Java Source  |  1997-04-19  |  580 b   |  27 lines

  1. class A {
  2.    public static void main(String[] args) {
  3.       A a = new A();
  4.       a.test();
  5.    }
  6.    void test() {
  7.       int a = 10;
  8.       int b = 13;
  9.       int c = 24;
  10.  
  11.       System.out.println("before: a = " + a);
  12.       System.out.println("before: b = " + b);
  13.       System.out.println("before: c = " + c);
  14.  
  15.       calc(a, b, c);
  16.  
  17.       System.out.println("after: a = " + a);
  18.       System.out.println("after: b = " + b);
  19.       System.out.println("after: c = " + c);
  20.    }
  21.    void calc(int a, int b, int c) {
  22.       a *= 2;
  23.       b *= 3;
  24.       c *= 4;
  25.    }
  26. }
  27.