How to let a method accept two types of data as argument?
问题 I have a method, accepting a Hashtable (yes I know, it's outdated..) as argument: public static LuaTable HashtableToLuatable(Hashtable t, int depth = 1) This works correctly. Now I'd like to accept an ArrayList as first parameter as well, so you can let 't' have the value of both a Hashtable and an ArrayList. Currently I have copy-pasted the method two times, like this: public static LuaTable ArraylistToLuatable(ArrayList t, int depth = 1) The rest is exactly the same. I think there's a way