fixing errors on a program to call methods in java

Try this: (not sure how many changes you have already made)

public class Oops3 {

public static void printer(double x, double y) {
        System.out.println("x = " +  x + " and y = " +  y);
        System.out.println("The value from main is: " + y);}

public static void main(String[] args) {

            int z = 5;
            double y = 867.5309;
            double x = 10.01;
            System.out.println("x= " + x + " and y = 8.0");
            printer( x,y);
            System.out.println("z = " + z);

}}

Leave a Comment

tech