is string a primitive type or derived type?

String is not a primitive type, it is a derived type.

Example

public class Main {
 
    public static void main(String[] args) {
        String dataBase = "Oracle";
        System.out.println("DataBase: " + dataBase);
        String myWebsite = new String("w3schools.com");
        System.out.println("Website: " + myWebsite);
    }
}

Output

Language: java
Website: w3schools.com

Java interview questions on String Handling