I am trying to create a GUI in Java, but this error keeps popping up and I do not know what to do to fix this error. Any help would be appreciated with fixed java code import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; public class HW4 { // Arrays to store data public int[] itemCode; public String[] itemName; public float[] unitPrice; // Item constructor HW4() { String[] data = new String[0]; // Reading file data = this.readFile(data); // Getting data itemCode = new int[data.length]; itemName = new String[data.length]; unitPrice = new float[data.length]; for (int i = 0; i < data.length; i++) { String[] dataDivided = data[i].split(","); itemCode[i] = Integer.parseInt(dataDivided[0]); itemName[i] = dataDivided[1]; unitPrice[i] = Float.parseFloat(dataDivided[2]); } } // Reading files from the source provided public String[] readFile(String[] records) { try (BufferedReader br = new BufferedReader(new FileReader("Items.csv"))) { String line; ArrayList recordsList = new ArrayList<>(); while ((line = br.readLine()) != null) { String[] values = line.split(","); recordsList.add(String.join(",", values)); } return recordsList.toArray(new String[0]); } catch (IOException e) { e.printStackTrace(); } return records; } // GetName function public String getName(int code) { return itemName[code - 1]; } // GetPrice function public double getPrice(int code) { return unitPrice[code - 1]; } } import java.util.Locale; import java.util.Scanner; public class OnlineSale { public static void main(String[] args) { // creating scanner class object Scanner sc = new Scanner(System.in); // Variables to store data String[] data = new String[100]; int count = 0; int code; double totalDataCode = 0; double sales = 0; System.out.println("Beginning a new sale (Y/N)"); String ans = sc.next(); while (ans.toLowerCase(Locale.ROOT).equals("y")) { if (ans.toLowerCase(Locale.ROOT).equals("y")) { do { HW4 n1 = new HW4(); System.out.print("Enter product code: "); String value1 = sc.next(); // Checking whether input is correct or not while (value1.charAt(0) < 48 || value1.charAt(0) > 57) { System.out.println("!!!Invalid product code"); System.out.print("Enter product code: "); value1 = sc.next(); } code = Integer.parseInt(value1); if (code == -1) { continue; } System.out.println(" item name: " + n1.getName(code)); String itemName = n1.getName(code); double price = n1.getPrice(code); System.out.print("Enter quantity: "); value1 = sc.next(); while (value1.charAt(0) < 48 || value1.charAt(0) > 57) { System.out.println("!!!Invalid quantity :"); System.out.print("Enter quantity code: "); value1 = sc.next(); } int quantity = Integer.parseInt(value1); double total = quantity * price; System.out.println("Item Total : $ " + total); totalDataCode = totalDataCode + total; data[count] = quantity + " " + itemName + " $" + String.format("%.2f", total); count++; } while (code != -1); System.out.println("---------------------------"); System.out.println("Item List :"); for (String datum : data) { if (datum != null) { System.out.println(datum); } } System.out.println("SubTotal $" + totalDataCode); double totalWithTax = totalDataCode + totalDataCode * 6 / 100; System.out.println("Total with tax " + String.format("%.2f", totalWithTax)); System.out.print("Tendered Amount : $ "); double amountPay = Double.parseDouble(sc.next()); while (true) { if (totalWithTax - amountPay > 0) { System.out.println("Enter tendered amount again."); amountPay = Double.parseDouble(sc.next()); } else { break; } } sales = sales + totalWithTax; double change = amountPay > totalWithTax ? amountPay - totalWithTax : 0; System.out.println("Change : " + String.format("%.2f", change)); System.out.println("---------------------------"); System.out.println(); System.out.println(); System.out.println("--------------------------"); System.out.println("Beginning a new sale (Y/N)"); ans = sc.next(); } } if (ans.toLowerCase(Locale.ROOT).equals("n")) { System.out.println("Total sales of the day is $ " + String.format("%.2f", sales)); System.out.println("Thanks for using Cortez's Sale System. Goodbye."); } } }