C # is derived from C and C , so it has a function of C , it is as simple as VB. For web development, C # is like Java, with some advantages of Delphi. Microsoft "C # is the best language for development .NET Framework application, how is its prospect, let us wait and see.
C # debut.
Let's see what C # is "stolen" from Java. C # is better than Java, which creates "Time" for its stealing, so C # can stand on the shoulders of Java. C # Why "Stolen" Java technology? Of course, the part of the stealing is a place that is exceeding the original C (of course, this part has caused a huge market impact on C ), and Microsoft has taken the "Takenance" technique, which uses the numerous characteristics of Java. , Grand launch of the new power of the Windows platform, it is really high, and the debut of C # is undoubtedly "shining". These "stolen" include: Both abandoned the C of the CONST modification, macro replacement, global variables, and global functions, etc., the pointer is gone, and it does not need to release the memory. 50% of the usual error will be reduced. When the pointer and increase the garbage collection mechanism, the miracle will happen, and the amount of bugs will be destined to be greatly reduced, and the memory leak will not happen. In addition, the C # of the wise god learned the single mechanism of Java, and also achieved "all are objects", abandoning the multiple inheritance between the original C multiple mechanisms and classes, because the two stuff don't hate too much Many classes that don't work together like a "net". Now, the son of the son of the son of Object is Object or the son of the son of the grandson, everyone is owned by Object, and Object is unified. But I can't let you "multiple inheritance", so I introduce this concept of "interface", I don't let you "even net", I am in touch with you, I will interface with you, exercise " The function of the correspondent, otherwise, in order to achieve multiple inheritance you, there may be no only one dad. C # can't bear to look at the older generation "pointer worshipers", did not completely abandon the pointer, C # allowed us to make a pointer operation in the Unsafe context.
Hey, how can I make the code platform? Java introduced a compiled code intermediate layer called byte code and uses a virtual abstract machine, not a real machine. When the Java compiler ends a source file compile, the resulting code can be immediately running on a given platform, but the one can run on any real platform, the only condition is this platform. To understand and support Java. C #, when the compilation source code is .exe file, the CLR will extract the important metadata in the compiler write code when it starts .exe. Next, a module called a Just-Time compiler maps the code into a particular CPU and starting the actual execution process. This undoubtedly stolen the concept of Java virtual machine. However, Java is a platform-independent and C # is largely suitable for Windows operating systems, and C # seems more passionate about XML Web Services interoperability in cross-platform, rather than cross-platform programming.