Why am I getting a compilation error

Every time I run this code it comes back with:
Exception in thread “main” java.lang.Error: Unresolved compilation problem: at problem4.main(line 3)
//which is the line that starts my main method. Why? I’m using vsc and was following along with my professor. His ran, mine didn’t.

Here is my code:
import java.util.*;

public class Problem4 {

public static void main(String[] args){    //error is here, apparently 

    double[][] matrix = new double[2][2];

    double[][] inverse = null;

   // Read the matrix


   //Calculate the inverse

    inverse = inverse(matrix);

    if(inverse == null){

        System.out.println("No inverse matrix");

    } else{

   // Output the inverted matrix

   System.out.println(inverse[0][0]+" "+inverse[0][1]);

   System.out.println(inverse[1][0]+" "+inverse[1][1]);



//required method header

public static double[][] inverse(double[][] A){

    double multiplier = 1 / ((A[0][0] * A[1][1]) - (A[0][1] * A[1][0]));

    double[][] B = new double[2][2];

    B[0][0] = multiplier * A[1][1];

    B[0][1] = multiplier * A[0][1];

    B[1][0] = multiplier * A[1][0];

    B[1][1] = multiplier * A[0][1];

    return B;


private static void readMatrix(double[][] matrix){

    Scanner input = new Scanner(System.in);

    System.out.print("Enter a, b, c, d: ");

    matrix[0][0] = input.nextDouble();

    matrix[0][1] = input.nextDouble();

    matrix[1][0] = input.nextDouble();

    matrix[1][1] = input.nextDouble();



Your code runs fine for me: You may have an error in the “run” configuration in VSCode.

What does that mean?

I recommend you review this VSCode support article on getting started with Java in VSCode.