Code:
import java.lang.Math;
class power2 {
public double square (int n) {
return java.lang.Math.pow(n,2);
}
}
class power1 {
public static void main(String args[]) {
power2 x1 = new power2();
int m =(int)x1.square(3);
System.out.println(m);
}
}
i'am using Jcreator pro for writing java code.i want to bundle these classes into a package say pack1;and i want to import this package to other place.how should i do it?
only writing package pack1at the top,does not work.....
Comment