O'Reilly logo

HoloLens Beginner’s Guide by Jason Odom

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Class methods

A class method is an action or a function. We have seen a few of these so far. Like variables, class methods can use access modifiers to allow or restrict external use. Using no access modifier is the equivalent to setting a method to private:

 [Access modifier] [return datatype] [method-name (parameter list)]  
{ 
       Method Body 
} 

This list will give a simple overview of the pseudo-code example above:

  • Access modifier: public/private/protected
  • Return type: The data type the method returns
  • Method name: A unique, case-sensitive name 
  • Parameter list (or the signature):  Many parameters can be passed into a method; each needs a type and a name
  • Method body: The instructions needed to accomplish the given task

Declaring a method looks ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required