I am experiencing a problem with this code:
public class gravityv1 {
public static double[] calculategravity(double[] mass, int[] diameter) {
double[
Change your main method declaration to:
public static void main(String[] args) throws IOException
In Java, each method A calling another method B, must declare all the exceptions
which B can throw (unless they are descendants of RuntimeException
or unless A
is catching and processing them explicitly in a try-catch block).
In your case A is main
, B is printFile
.