char is a primitive type , and its value is added to int , and String is an object .
On the other hand, there is a function in java called autoboxing, where some primitive types are assigned to objects when they are suitable (for example, from int to Integer , boolean to boolean ), but this does not work for char . char gets autoboxed up to Character .
source share