Cannot create a Java Stack

I’m getting an error when I try to create a Stack.

Repl link:

import java.util.*;

class MyStack {

  public static void main(String[] args) {

    //Issue with replit. Use another IDE.
    Stack <Integer> stack = new Stack <Integer>();

    for (int i = 0; i < 10; i++) {


Hi @hbijli I think you have created the Repl using the wrong template.

I just recreated your code using a Java template and it worked first time.

The icon background for the Java template should be dark blue not white. Hope this helps.

Thank you Ian. That worked. I was trying to move my other files to the Java template. I couldn’t find an option to do it. It’s not a big deal though.