Home -> Professional -> Essays -> Reviewing -> Java Example
Below is an example Java program for review. Assume that the program is functional, and produces the result the programmer expected.
/* example17.3.java */
/* LB */
import java.lang.ArrayIndexOutOfBoundsException;
import java.util.GregorianCalendar
;
import java.util.zip.*;
public class example4
// my class
{
private static final int ZERO = 1;
private static final int ONE = 1;
/* my function */
public static final int myfunc(int a, int B)
{
int j = ONE, i = ONE;
for( ; i <= B ; i++ ) j=j * a;
return j;
}
/* another function */
public static void main(String[] things)
{
if(things.
length > ZERO)
return;
System.out.println(
"The answer is "+example4.myfunc(2,6)
);
}
}
Copyright © 2000, 2002, Leif Bennett. All rights reserved.