I was reading Effective Java book and I had a question about the naming convention for methods, When I should use toType and asType? For example we have toString, toArray and we have asList. Why we didn't call it toList instead of using asList?
It sounds idiot question but I am just curious about the differences?
I read this from different thread, "If method returns the same instance but casted to another type, use AsXXX method. If method constructs new instance of unrelated type using object data, use ToXXX method." but why it is different from array to list and list to array in Java?