[Solved] What is the difference between object and object[] in java [closed]


Simply, the difference is that Object is a single object whereas Object[] is an array (multiple or collection) of indexed objects.

For example you could have an object that contains a string like

Object obj = "Hello";

or you could have an array of strings like

Object[] objArray = new Object[2];
objArray[0] = "Hello,";
objArray[1] = " world!";

So, obj is one Object. Whereas, objArray is an array that contains multiple objects indexed starting with 0. Hopefully this helps!

solved What is the difference between object and object[] in java [closed]