I'm learning Java and I can't understand why variables are created the way they are. For example: int[] numberArray = new int[10];
or StringBuilder newString = new StringBuilder();
Surely when you create the object (like an array of integers of size 10) the type can automatically be inferred and doesn't need to be specified again, or for the 2nd case, I'm creating a StringBuilder, which means Java would already know the object that it is going to be right?
I'm coming from having my main language be Python and while I know Java is statically typed it doesn't make sense that this is necessary.