Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Set marked by the compiler as "not a known variable in this context"?

This is my code;

import java.util.*;  

  class State extends HashMap<Character, State>{

    boolean isFinal;

    State () {
        isFinal = false;
        }

    }

      class Automaton{
        private Set<State> allStates;
        private Set<State> finalStates;
        private State initialState;
        private State currentState;
        private Set<Character> alphabet;


        Automaton() {


            allStates = new Set<State>();
        }

 }
like image 876
andandandand Avatar asked Dec 17 '25 22:12

andandandand


1 Answers

allStates = new Set<State>();

Set is an interface. So maybe you mean HashSet?

like image 197
PSpeed Avatar answered Dec 20 '25 11:12

PSpeed