Recipe for Learning programmming :(Reference:http://norvig.c... Get interested in programming, and do some because it is fun. Make sure that it keeps being enough fun so that you will be willing to put in ten years. Talk to other programmers; read other programs. This is more important than any book or training course. Program. The best kind of learning is learning by doing. To put it more technically, "the maximal level of performance for individuals in a given domain is not attained ......
I was trying to implement an Interface by a class but i wanted to have static methods. But C# doesn't allow static methods in interface. After a little search,I got "why We can't have static methods in Interfaces". suppose i have an interface, interface IDemo { static void add(); } Now we implement it: class MyClass:IDemo { static void add() { Console.WriteLine("Added"); } } Pretty cool na. But it won't compile. because what if IDemo.add(); To avoid this ambiguity, Static Methods are not allowed ......
I was writing an app in which i needed to store a dictionary.. I thought to post the code..: public void StoreDictionary(Dictionary&... files) { FileStream fs = new FileStream(fileName, FileMode.Create, FileAccess.Write); BinaryFormatter bf = new BinaryFormatter(); bf.Serialize(fs, files); fs.Close(); } public Dictionary<string, FileInfo> RetrieveDictionary() { FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read); BinaryFormatter bf = new BinaryFormatter(); ......