How java create objects implicitly? Like in case of String class
问题 I can't understand how an object is created implicitly. Example: String s = "implicit instantiation"; Can I make my own class whose objects can be created implicitly? 回答1: No, String instantiation is handled implicitly by the compiler. Only the String and Array classes have this property. String greeting = "Hello world!"; char[] helloArray = { 'h', 'e', 'l', 'l', 'o', '.' }; Autoboxing allows you to implicitly instantiate objects of primitive wrapper types, but that's also a special case