Sb explain constructor please. | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

Sb explain constructor please.

public class MyClass { public static void main(String[ ] args) { Vehicle v = new Vehicle("Blue"); } }

5th Aug 2017, 7:49 AM
Dariush Shiri
Dariush Shiri - avatar
1 Réponse
+ 12
You create a new instance of the class Vehicle represented by object v, and then initialize the object with "Blue".
5th Aug 2017, 7:55 AM
Hatsy Rei
Hatsy Rei - avatar