What's the difference between using a typed vs. non-typed
ArrayList<CustomObject> typedArray = new ArrayList<>();
ArrayList<> nonTypedArray = new ArrayList<>();
It's never preferable to use the latter option. I don't think that is even possible. I think you meant:
ArrayList nonTypedArray = new ArrayList();
This syntax is left over from Java 1.4 and earlier. It still compiles for the purposes of backwards compatibility.
Generics was introduced in Java 1.5 which allowed you to specify the types between angled brackets.
It is always preferable to use generics because it is more type-safe.
That is, if you specify
ArrayList<String> typedArray = new ArrayList<String>();
Then you cannot accidentally add an integer to this array list; if you tried to add an integer, the program would not compile.
Of course, Generics ensures type safety at compile time. At runtime
ArrayList<String> typedArray = new ArrayList<String>(); becomes
ArrayList typedArray = new ArrayList();. This is to maintain backwards compatibility.