January 2018
Intermediate to advanced
678 pages
20h 16m
English
static MethodsIn this section, we continue to work our way through the Point Tracker web page’s Point class definition, with a focus on the getCount and distance methods. They’re static methods, which work a bit differently than regular methods.
In the previous section, we examined the Point class’s constructor. After the constructor comes the value method. It’s the same value method that we looked at in Section 11.3. It returns a Point object’s value in the form “(x, y).” Next is the getCount method….
getCount MethodAs its name implies, the getCount method returns the count property (which holds the number of Point objects). For methods that return a property, it’s standard practice to use “get” as the first word in their names. ...
Read now
Unlock full access