String is a non-primitive data type because primitive data types cannot have methods. Only class can. Stings also need to call upon several functions while processing like substring, indexof, equals, touppercase. This could not be possible without making string class.