I have a method that takes a parameter of type Object:
public static void test(Object foo)
{
System.out.println(foo);
}
I can pass foo: Strings, integers, booleans, etc...pretty much anything. I think this is possible because Object is the base class from which everything else inherits from, and therefore it accepts any data type as valid. I could understand this being the case with objects like Strings, and Arrays. But why is this the case with primitive types? Do integer, char, and boolean also inherit from Object?