Recap and booleans.

A quick recap


  • You don’t have to capitalize class names for the program to compile, but is a good idea/coding convention to do so.

  • readonly fields can be set only during object construction

  • Constructors cannot return anything, they are void methods.

  • Public fields are directly accessible from outside the class

  • Private fields can only be accessed from within the class they are defined in

Boolean Values


Boolean values are essential to know. We want to create a Method (behavior) of the map that will let us know if a particular point is in bounds or not. an OnMap method is an example. We would have a boolean (True/False) variable where if the width or height are greater than the map values passed in then the OnMap method would return false. Letting you know the point is not on the map.



C# uses a practice called short-circuiting. This means that it will try and do as little work as possible when evaluating a Boolean expression. Some operators include ||, &&, and the !.



More info can be found at the following links about &&, || and

Knowing how these operators work in your sleep will definately help you along in all aspects of development. It also sometimes comed in handy in life when making choices between one thing or another.