Is “abc” a primitive value?

No, “abc” is not a primitive value. It is a string object. Example

public class Main{ 
    void show(){  
         System.out.println("abc".getClass().getName());
     }  
     public static void main(String args[]){  
      Main obj=new Main();  
      obj.show();  
     }  
}

Output

java.lang.String
Please follow and like us:
Content Protection by DMCA.com