Current location - Quotes Website - Signature design - What are the differences and advantages between JAVA and. net?
What are the differences and advantages between JAVA and. net?
1.Java is simple

Java is very similar to C++, but it is much simpler. Of all the characteristics of high-level programming language,

is not absolutely necessary and has been deleted. For example, Java has no operator overload, title text,

preprocessing, finger operation, construction, conjunction, multi-dimensional number group, template and implicit type transformation. If you know a little about C, C++ or Pascal, you will soon be able to control Java. This is a simple Java Hello World program:

public class hello internet {

public static void main (string argv []) {

system. out.println ("hello in-internet!") )

}

}

2.Java is object-oriented

Java is a programming language of object-oriented. Except for simple classes, such as numbers and Boolean operators

, most parts in Java are objects.

just like the language of any object, Java codes are also organized by classes. Each class defines a

set of rules for the behavior of the image line. A class can inherit a row from another class. At the

root level of a class, it is usually a class object.

Java supports the hierarchical structure of single inheritance class. That is to say, each class can only inherit one other class at a time. Some words allow multiple inheritance, but this can create confusion and make words unnecessarily

mixed. For example, it is difficult to imagine that an object will inherit the lines of two completely different classes.

Java also supports the interface of abstract classes. This allows the programmer to define the formula of the interface first, rather than

being in a hurry to determine the reality of the formula immediately. A class can implement multiple interfaces, and it has many excellent points of < P > true multi-inheritance. An interface that can also be used to measure images at will. Java

interface is very similar to IDL interface. It is easy to build an IDLJ compiler. That is to say, Java can be

used in CORBA object system to establish distributed object system. Considering that IDL interface and CORBA are used in many computer systems < P >, this compatibility is important.

3.Java is a static type

In a Java program sequence, it is necessary to define the type of the object (number, symbol, number group, etc.) used.

This is helpful for programmers to find out questions quickly, because when compiling and translating the program sequence, they can detect the type of errors

.

however, objects in the Java system also have dynamic types. It is possible to find that an object is a dynamic class, and the program written by the programmer can do different things for objects of different classes.

4.Java is compiled and translated

When running a Java program, it is first compiled and translated into a section code. Word-section substitution code is very similar to

machine instruction, and the Java program is very efficient. However, the word section generation code is not specific to a particular machine, and the Java program can be executed on many different computers without re-editing and translating.

Java source program sequence is compiled and translated into a kind of document, which is equivalent to the code representation of the program sequence. In a

Java-like document, all references to the square method and real variables are entered by name, and they are distinguished when the code is executed for the first time

. This makes the code more universal, less susceptible to the influence of modification, < P > and still has high efficiency.

5.Java is in the system structure.

Java language is the same for every computer. For example, the types of simple words are the same: the integer

is always 32 bits, and the long integer is always 64 bits. Strangely enough, the

programming language such as C and C++ is not like this. Because these words define the meaning, each compiler and

development environment are different, which makes the transplantation of process sequence an annoying question. The transplantation of Java program

is easy, and there is no need to re-edit and translate it.

6.Java is sound

Java programs cannot be made into computer crashes. The Java system carefully examines every

interview with the internal memory, and confirms that it is legal and does not lead to any questions.

if you don't, you can make mistakes in Java programming. If something unexpected happens, the sequence

will not collapse and the case will be discarded. The process sequence will appear outside this kind of case and be dealt with.

the transmission sequence can be stored in the whole part of the interview computer. The process sequence can (unconsciously) modify any value in the memory of

, which will create a question. Java programs can only access those parts of the memory that are allowed to be accessed by them. Therefore, Java programs cannot modify the values that are not intended to be modified.

7.Java is clever

Because Java is designed to run on a small computer, as a programming language,

its system is relatively small. It can be effectively transported on a PC with 4MB RAM. Java

translators only take up a few hundred KB. This translator is reliable for Java platform independence and portability < P >.

Because Java is very small, it is ideal for computers with small memory, such as PC computers based on Java, video cameras, baking boxes, telephones and home computers.

8.Java is a multithreaded

Java program can execute a multithreaded process. For example, it can be calculated by completing

a certain time-consuming calculation in one route, while the other routes are interactive with the users. Therefore, users don't have to

stop working until the Java program is finished.

It is often difficult to program in a multi-line environment, because many things can appear at the same time

. However, Java provides easy-to-use synchronization characteristics, making programming more convenient.

Java threads are often mapped as real operating system threads, and only the bottom operating system branches

hold this mapping. Therefore, the application program written in Java can be said to be "MP fever" That is to say,

if they are transported on multiple processors, they will be more conspicuous.

9.Java can collect useless storage units.

Programmers who write software in C and C++ must carefully follow the memory blocks used. When a block

is no longer used, they must let the program release it, and then they can use it again. In a big project

, this can be very difficult, and it will become the root cause of mistakes and insufficient internal storage.

in the case of Java, programmers don't have to worry about memory management. The Java system has a built-in program called

as a "useless unary collector", which scans the memory and automatically releases those memory blocks that are not

reused.

1.Java is fast.

Java is more effective than classical footwork, but it is 2 times slower than C. This is acceptable for large numbers to use

.

in the near future, the code generator will be available for use, which will make the Java program almost as fast as the program written in C

or C++.

11.Java is secure.

Java programs have no pointers, and word-generation programs like this are stronger than classes, so it can verify Java programs before

execution. The verified Java program can be guaranteed not to break any restrictions of Java language, and can be executed safely. Java word segmentation code verification is used by

Web browser to ensure that the applet does not contain virus.

12.Java is extensible

Java programs can be linked with existing program libraries written in other languages. Because Java data structure

is very similar to C data structure, this is convenient. The biggest question lies in

, but there are few multi-line engineering sequence libraries.

Java programming can declare that some methods are internal, and then map these internal methods into functions defined by

software library. Link from passive state to virtual simulator

----------------------------------. Although there is nothing wrong with this standard itself, it is incompatible with areas outside Microsoft. In other words, this standard has become a bottleneck to achieve interoperability with other software platforms.

in addition, data is also a problem. Although ADO simplifies data access, it becomes a problem to transfer data from one place to another. ADO Recordset object is a binary structure that stores data, and this binary format has no meaning for non-Microsoft platforms.

.Net makes up for these shortcomings because it is completely based on standards. For example, the data passes through the process boundary in XML format, and this data has a connection to XSD, so any client can transform the data correctly.

SOAP is based on XML and is used for communication with Web services. After integrating SOAP, whether the client is running Microsoft operating system or not, it can realize simple programmable access.

2. Simplifying the application of

COM is a headache.