Difference between revisions of "Location"

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
(Created page with "==The code== <syntaxhighlight lang="csharp" line> class Location { public Fox Fox; public Warren Warren; public Location() { Fox = null; Warr...")
 
(The code)
Line 11: Line 11:
 
       Warren = null;
 
       Warren = null;
 
     }
 
     }
</syntaxhighlight>  
+
  }
 +
</syntaxhighlight>
  
 
=Explanation=
 
=Explanation=

Revision as of 21:54, 29 November 2016

The code

 1   class Location
 2   {
 3     public Fox Fox;
 4     public Warren Warren;
 5  
 6     public Location()
 7     {
 8       Fox = null;
 9       Warren = null;
10     }
11   }

Explanation

A location has 2 data items within the class, a Fox called Fox and a Warren called Warren.

When the location is created both are set to null.