Nm parameter | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Nm parameter

hello i was wondering ( and it's irritating me To see it often without knowing the meaning ) what the nm in a code means ? for example in the code below! I think it means Name but why is it just "nm" ?

30th Jun 2017, 5:03 PM
François Ponsaillé
François Ponsaillé - avatar
3 Answers
+ 4
nm is just a parameter for the constructor Car. so if u have Car("Lol") as argument, nm will be "Lol"
30th Jun 2017, 5:22 PM
David Sebastian Keshvi Illiakis
David Sebastian Keshvi Illiakis - avatar
+ 4
if u want to leave the Car constructor blank, then u wont have to specify any constructor at all. like if u declare a Car instance u can just do new Car();
30th Jun 2017, 5:30 PM
David Sebastian Keshvi Illiakis
David Sebastian Keshvi Illiakis - avatar
0
class Car { string name; public Car(string nm) { name = nm; Motor m = new Motor(); } public class Motor { // some code } }
30th Jun 2017, 5:04 PM
François Ponsaillé
François Ponsaillé - avatar