Programming Stuff

Type Methods Doesn’t have Scope

I was thinking that if a Method can be use as type (first class) such as pass as parameter, then their scope (private, public, etc) won’t matter any more…

here a couple of examples… this is a non-sense example, but I hope you catch the idea.

1. I create an object country that has a private method and I used it in 3 different ways (Event handler, delegate,  Func)

 

2. In the main program, I bond OnExists event to print the cities of FL, and other getPrivateFunction 1 & 2 do basically the same thing…

Finally, I invoked GetCities 3 times, but I cannot invoke  c.GetCities("FL");