Differences

This shows you the differences between two versions of the page.

Link to this comparison view

cs-142:static [2016/11/14 17:38]
kseppi created
cs-142:static [2016/11/14 17:41] (current)
kseppi
Line 12: Line 12:
     // We want the serial number to be constant for each widget, but we each should get its own value.     // We want the serial number to be constant for each widget, but we each should get its own value.
     // We will mark the serial number as constant but not give it a value yet, which seems a little strange.     // We will mark the serial number as constant but not give it a value yet, which seems a little strange.
-    // Rmember ​that the .h is just a template, nothing is really being created.+    // Remember ​that the .h is just a template, nothing is really being created.
     const int serialNumber;​     const int serialNumber;​
     // In this context static means that there is only one nextSerialNumber value, not one for each object.     // In this context static means that there is only one nextSerialNumber value, not one for each object.
     // All instance of the class can see and set this value, but they all see the same value. In other     // All instance of the class can see and set this value, but they all see the same value. In other
-    // languages this ic called a "Class variable"​ indicating that it is shared by all instances of the+    // languages this is called a "Class variable"​ indicating that it is shared by all instances of the
     // class.     // class.
     static int nextSerialNumber;​     static int nextSerialNumber;​
Line 30: Line 30:
 // The next line has two interesting features: // The next line has two interesting features:
 //  1) When we create a new widget we can use initialization to give it a value for the constant serialnumber! //  1) When we create a new widget we can use initialization to give it a value for the constant serialnumber!
-//     This is allowed because when the constructer ​is executed, a new widget is comming ​into existance ​and+//     This is allowed because when the constructor ​is executed, a new widget is coming ​into existence ​and
 //     needs to know what value it's constant should have. //     needs to know what value it's constant should have.
 //  2) As noted above, there is only one variable called nextSerialNumber,​ we can use that to set the new //  2) As noted above, there is only one variable called nextSerialNumber,​ we can use that to set the new
cs-142/static.txt ยท Last modified: 2016/11/14 17:41 by kseppi
Back to top
CC Attribution-Share Alike 4.0 International
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0