Java and. NET in the development of different inventory, java.net inventory
I used VS2008 and VS2010 for development. . NET program. JAVA program is developed through MyEclipse8.5. The following describes the differences among IDE, language, and plug-in. However, due to limited experience and knowledge, this article can only explain the differences I have seen from the superficial and commonly used functional points.
IDE differences:
The first thing I feel is that it is very convenient for MyEclipse to compile and view code during the development process, and there are even many functions not available in VS. The following lists some differences I have encountered:
1. MyEclipse does not have a code segment area like # region and # endregion in VS. In a method or class, you can # region function points... # Endregion folds the code snippet so that MyEclipse can achieve this effect unless it uses other plug-ins.
2. Import a new project using MyEclipse. If the JRE version is different, you must use the local JRE version, right-click the project-> Build Path-> Configure Build Path-> Libraries-> modify the JRE version in Java Build Path, but sometimes compilation problems may occur, the reason is that the compiled JDK version is not selected. Right-click the project and choose Build Path> Configure Build Path> Java Compiler to modify the Compiler compliance level. for VS, the higher version code opens the lower version code and will be automatically upgraded or manually selected in. Which of the following versions of NET is easier to compile.
3. For a code segment with braces or parentheses, double-click the symbol to automatically select the code segment inside the brackets. This allows you to conveniently view a code segment. VS does not have this function.
4. When debugging code, VS is more powerful than MyEclipse. They can modify the values of existing variables at the breakpoint, however, when entering a variable in the monitoring temporary variable box, VS can intelligently prompt its own code, while MyEclipse cannot automatically remind you, and VS can drag the breakpoint to the running code, this feature is very powerful and useful in debugging, but MyEclipse cannot drag breakpoints.
5. Double-click the Tab bar of the file in the code editing box of MyEclipse to switch the code editing block and multi-box display in full screen mode, which is more convenient than, there is a Link Vith Editor button next to the Package Explorer box to quickly locate the file in the Package. This is also convenient, however, after right-clicking a file in VS, you can directly open the corresponding physical file directory. This function is not available in MyEclipse.
6. the JAVA project is opened through import instead of double-clicking in. Sln or. The csproj file can open the entire project. However, after a project is opened, MyEclipse will be automatically loaded next time. VS enables only one solution at a time, including different projects. If a solution is added, it needs to be opened separately next time.
Language differences:
The Java language is very similar to the C # language. Although there are many differences internally and different APIs are provided, the idea of developing a specific function is similar, since there are not many contacts with relatively new technologies and features in the development process, my differences include:
1. The default modifier in JAVA is visible in the package (corresponding to the same folder directory, rather than under the big jar package of the Project). The variables and methods of protected are visible in the package and subclass ,. NET is only visible to itself and its subclass. NET class's default modifier is Internal, which can be accessed within the Assembly. The method and field are private by default, which is different from that visible in the JAVA default package.
2. If you find a JAR package, you can view the Method Field description of the new jar package in Java. You must have a separate doc file for the corresponding jar package to see the interface call parameter description, otherwise it may not look intuitive, but if there is a jar package from the source code, you can easily see that the source code of the package is NET, as long as there is a dll file, you can easily see the call parameters of the method metadata, but you can see the detailed descriptions of the parameters, you still need the xml document corresponding to the dll.
3. The Byte numeric range is different. in Java, the range is-128 to 127 ,. NET is 0-255, usually need to exchange data and processing are converted to hexadecimal, and then take the last two bits of 8 bits, so that their values are the same, facilitate synchronous encryption/decryption or related processing
4. automatically compile the files stored in JAVA by default, but this also benefits from compiling each java file into a class file ,. NET, because it is a project and a dll file, if one of them is saved. If all the cs files are compiled, the development speed is greatly affected by the heavy workload.
5. Final keywords in Java. When a field is given, it indicates that the field cannot be modified, and cannot be modified in the constructor. This is a bit like const of C, however, the const is static by default. It is also similar to the readonly of C #, but readonly can be modified in the constructor. When it acts as a modifier of a method, it tries to use the sealed class of c # And cannot override it.
6. the Java package name corresponds to the physical file location. The namespace in C # can be written at will, and the compiled assembly can be changed at will, it may not be the same as the namespace. The jar package separately created in the Assembly and JAVA is similar.
7. get and set methods are recommended in Java to assign values to internal variables and obtain values ,. NET can be obtained using the get and set fields, and after vs2008, you can directly get; set;. With the help of syntactic sugar, the compiler will automatically generate the equivalent get and set internal fields.
Differences between plug-ins:
1. MyEclipse is a plug-in, which integrates a large number of open-source frameworks. VS is a unified IDE of Microsoft. To use other open-source plug-ins, You need to download and configure them separately. Www.2cto.com
2. There are many methods to implement webservice in Java, except javax. jws package only JAX-WS, java webservice specification comes with version, and axis, xfire webservice Open Source implementation, axis including axis1, axis2, xfire has been renamed to cxf, but various implementation methods are different, in and. When the webservice released by NET is called each other, some problems are often encountered. In general, Java has stricter requirements on the wsdl format.