为什么Set被编译器标记为“在此上下文中不是已知变量”?

时间:2009-12-09 00:40:00

标签: java compiler-errors

这是我的代码;

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>();
        }

 }

1 个答案:

答案 0 :(得分:9)

allStates = new Set<State>();

Set是一个界面。那么也许你的意思是HashSet?