views:

97

answers:

1

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

 }
+8  A: 
allStates = new Set<State>();

Set is an interface. So maybe you mean HashSet?

PSpeed
Makes sense, but I get the compiler message "Cannot instantiate the type Set<State>" which makes a lot more sense to me. Can someone explain the message dmindreader got and why we didn't get the same one?
MatrixFrog
Probably impossible to say given the information provided. Without the specific error and more of the relevant code (I assume this has been abbreviated) I can't say. I would also have expected the error you are seeing.
PSpeed
I suggest the error message is misquoted. Googling for “not a known variable in this context” gets this page...
Tom Hawtin - tackline