Object Oriented Programming using C#

(backadmin) #1
Object Oriented Programming using C#
Generic Collections and how to Serialize them

Note this method will generate an exception if the ‘key’ is not unique and this error should be trapped and dealt with
....though in this simple case we have decided to take no action should this occur.

The TryGetValue() method requires an input argument, the key it is searching for and sets the value of the second argument
to the value associated with that key. In our example it sets the second parameter to the account associated with the
account number. Note this will be null if the account number does not exist. See code below :-

accounts.TryGetValue(number, out a);

what‘s missing in this equation?


maeRsK inteRnationaL teChnoLogY & sCienCe PRogRamme

You could be one of our future talents


Are you about to graduate as an engineer or geoscientist? Or have you already graduated?
If so, there may be an exciting future for you with A.P. Moller - Maersk.

http://www.maersk.com/mitas

Please click the advert

Free download pdf