TOPIC

It says runtime error

Tahsin09 asked 5 years ago

Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. Command exited with non-zero status (1)

Here's my code:

import java.util.Scanner; public class Main {

public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    for (int i = 0; i < 7; i++) {
        if (i == 0 || i == 6) {
            System.out.println("---------------------------------------");
        } else if (i == 1) {
            System.out.println("|x = 35                               |");
        } else if (i == 3) {
            System.out.println("|               x = 35                |");
        } else if (i == 5) {
            System.out.println("|                               x = 35|");
        } else {
            System.out.println("|                                     |");
        }
    }
}

}

This topic was solved and cannot recieve new replies.