I have been learning J2SE recently. After about 20 days, I finished reading J2SE by Mr. Ma Bingbing. I feel that this teacher is so humorous that I will not be distracted when listening to his lectures. The utilization of time is very high. I sincerely give a thumbs up to Teacher Ma Bingbing, and two more thumbs up to Teacher Mi who made us learn this video! (There are many beautiful things in the world, but what is lacking is the eyes to discover beautiful things!).
Without further ado, let’s take a look at what is actually said in this video. As shown below:
People who may have studied any object-oriented language (I studied C#, which is modeled after Java and further improved Java), the first impression when seeing this picture is that they have basically studied all these things. It seems that there is only GUI, JDBC is a new thing.
In fact, they are really similar. Most people think they are the same anyway. Compare them below!
In terms of syntax, both have abandoned many flashy places such as const modification of functions and their parameters in C++, macro substitution, global variables and global functions.
In terms of inheritance, both adopt single root inheritance and multi-interface implementation solutions that are easier to understand and construct. In terms of source code organization, better logical encapsulation that integrates declaration and implementation has been proposed.
In terms of type unification between basic types and single-root inherited objects, the box/unbox proposed by C# is smarter and more efficient than Java's packaging class.
Component-oriented is undoubtedly the mainstream of contemporary software development. C# has even become "obsessed" with component programming, which is completely different from Java, which debuted 6 years ago - of course this is a matter of the times. C# implements its first-hand support for component programming through properties, indexers, delegation, events, operator overloading, traits, versions, etc. Although these can be implemented indirectly through methods, interfaces or adapters in Java, the history of the software industry tells us that this is a great damage to programming efficiency or logic design - the first thing high-level languages face is People, not machines. In addition to these language-level component support mechanisms, the .NET platform also provides a package solution for component configuration, operation, management, etc., and Visual Studio.NET, which is tailor-made for component development, is even more exciting. This is all for C# Component programming opens up a vast world. In terms of other technologies, Java's weak disadvantages are negligible, but in terms of component programming, Java has incurable flaws compared to C#. Especially for developers who come from a C++ and Visual Basic background, C# has an irresistible charm and temptation in this regard.
In terms of cross-platform, Java's support and implementation are praised, although the speed of JVM is still a headache. Although C# has fully considered portability in terms of underlying structure, at least there is no mature and tested product yet. C# seems to be more interested in XML Web Services interoperability than cross-platform programming. However, C#'s object-level interoperability support for more than 20 mainstream languages through its basic language construct (CLI) has greatly enhanced C#'s technical status. Cheap interoperability with COM components also earns C# a lot of points - maintaining a compatible system is very important for the modern software industry, and it is also a sign of responsibility for the majority of developers.
Of course, a comprehensive technical evaluation of the two languages is by no means just a simple list and comparison of the above points. Their back-end platforms (C# for .NET, Java for J2EE), the support of their programming frameworks, and the implementation of relevant tools for each language are now Some system foundations and so on have a considerable impact on the development of programming languages. From a purely technical perspective, C# is undoubtedly more competitive than Java. There is no point in arguing about who copied who - the development of technology is inherently a process of mutual learning. Pure technical competition cannot determine the outcome of this debate - if it has to be a showdown. The software industry is happy to see competition. Only technology that has been tempered by the market can serve us better. Let us wait and see!