Current location - Trademark Inquiry Complete Network - Tian Tian Fund - Why have so many programming languages ??been developed?
Why have so many programming languages ??been developed?

The similarities between C# and JAVA: Since C# and JAVA are both developed based on C++, there are many similarities between the two, as follows: 1. The compilation results of C# and JAVA languages ??are independent of computers and programming languages.

Yes, executable files can be executed in a managed execution environment; 2. Both C# and JAVA languages ??adopt automatic garbage collection mechanisms; 3. Both C# and JAVA languages ??cancel pointer operations; 4. Both C# and JAVA languages

There is no header file; 5. Both C# and JAVA languages ??only support single inheritance. To achieve functions similar to multiple inheritance, it must be implemented through interfaces; 6. Classes are derived from the Object class, and the objects of the class are passed through keywords

new generation; 7. Both C# and JAVA languages ??support threads; 8. Neither C# nor JAVA languages ??have global variables and global functions, and all variables and functions belong to a certain class; 9. Both C# and JAVA languages ??support arrays and

Strict checking of string boundaries will prevent boundary overflow; 10. Both C# and JAVA languages ??use the "." operator, and the "->" and "::" operators are no longer used; 11. C# and JAVA languages

Both use null and bool as keywords; 12. All values ??in C# and JAVA languages ??must be initialized before they can be used; 13. The if statements in C# and JAVA languages ??do not allow integers as judgment conditions; 14. C# and

The try statement block in the JAVA language can be followed by a finally statement block.

The difference between C# and JAVA: Although C# and JAVA have many similarities, because they are high-level programming languages ??developed by two different companies, they are independent of each other and self-contained, each with some unique characteristics.

, the following are the differences between C# and JAVA: 1. Properties For developers who often use rapid development tools, such as Delphi or Visual Basic, properties are a very familiar concept.

Generally speaking, the value of the attribute can be read through getXXX, and the value of the attribute can be set through setXXX.

The more common attribute operation statements in JAVA: foo.setSize(foo.getSize()+1); label.getFont().setBold(true); The more common attribute operation statements in c#: foo.size++; label.font.

bold=true; Obviously, the above property setting method is simpler and more readable than JAVA.

This fully reflects the simplicity of C#.

JAVA's definition of properties: public int getSize(){ return size; } public void setSize(int value){ size=value; } C# has simplified the definition of properties: public int Size{ get{ return size; } set{

size=value; }} 2. index C# provides index to add an index to an object, thereby processing objects in a manner similar to arrays. The JAVA language does not support index. The typical way to define index in C# is as follows: public Story

this[int index] { get{return stories[index]; } set{ if(value!=null){ stories[index]=value } } 3. delegate: can be considered a type-safe, object-oriented function pointer

.

C# enables a delegate to access different functions through a name. It implements a similar function to the interface in JAVA, but it is easier to use than the interface.