Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

[In Java] What am I doing wrong with my code on line 15? What I plan to do: create a hash table with the String

[In Java]

What am I doing wrong with my code on line 15?

image text in transcribed

What I plan to do: create a hash table with the String keys "+", "-", "/", "*" . And the values would be the object(of the classes). I have already made Addition.java, Subtraction.java, Multiplication.java, Division.java. They all have nothing filled in them.

image text in transcribed

Evaluatorul.java Operator.Java |! | 0 java 2 Operand.java 1.aye'E 8gIls. Additionjava Subtraction.java. Source History |,. | | import java.util.HashMap: /*Hashmap K-keys V type of mapped values 6 public abstract class Operator // The Operator class should contain an instance of a HashMap // This map will use keys as the tokens we're interested in, // and values will be instances of the Operators. 10 12 13 14 // Example: // Where does this declaration go? What should its access level be? // Class or instance variable? Is this the right declaration? static Ha3hMap opera tor = new Ha3hMap(){ operator.put(, new Addition) 16 17 18 19 20 21 //map.put"-, new Subtraction) public abstract int priority): public abstract Operand execut rand op1, Operand op2) 23 24 25 26 public static boolean check( String token return false

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Handbook Of Relational Database Design

Authors: Candace C. Fleming, Barbara Von Halle

1st Edition

0201114348, 978-0201114348

More Books

Students also viewed these Databases questions

Question

What lessons in OD contracting does this case represent?

Answered: 1 week ago