We know that it is possible to pass values through the constructors of an object, see this example:
String primeira = "Java";
String segunda = "Csharp";
String terceira = new String("pyhton");
In my first two attributes I didn’t instantiate any object, why didn’t it give an error? Is this instantiation done behind the scenes in Java? If it were another class instead of the String class, would it give an error?
I looked in the documentation and didn’t find any answers.
New contributor
viniideveloper is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.