Java Expressions and Assignments

profilevhramu223
Environment.java

// This class provides a stubbed-out environment. // You are expected to implement the methods. // Accessing an undefined variable should throw an exception. // Hint! // Use the Java API to implement your Environment. // Browse: // https://docs.oracle.com/javase/tutorial/tutorialLearningPaths.html // Read about Collections. // Focus on the Map interface and HashMap implementation. // Also: // https://www.tutorialspoint.com/java/java_map_interface.htm // http://www.javatpoint.com/java-map // and elsewhere. public class Environment { public int put(String var, int val) { return val; } public int get(int pos, String var) throws EvalException { return 0; } }