I've been trying to build an object of some sort which allows dynamic key adding/removing, similar to javascript objects.
I'm trying to do something like this in java(code below is javascript):
const object = {};
object["foo"] = "bar";
console.log(object);
// { "foo": "bar" };
delete object["foo"];
console.log(object);
// {};
I've tried doing:
String[] arr;
arr["foo"]="bar";
Although that definitely won't work as "String cannot be converted to int".