For beginners: Java and Applications

Source: Internet
Author: User
For beginners: Java and Applications

I have been learning Java for three years.

From unknown Java to a small J2EE Project Manager

Although it cannot be said that this Master, it is probably a bit too much.

Every time I access the Internet, I bubble BBS to visit the forum, and I did not go to the Java-related layout.

The general feeling is that there are more beginners, fewer masters, and less proficient.

 

Due to the outdated teaching materials in China's higher education system, Java has developed itself for about 10 years.

Another important reason is that Java is more suitable for commercial applications.

Therefore, most doctoral teachers in colleges and universities know more about this language than undergraduates.

In this environment, many people are confused about Java and do not know what Java can do.

Even if you know that Java is useful, you are not sure where to start.

Therefore, it is difficult to get started with Java.

 

Okay, let's start with what Java can do.

 

Java

 

Java is an object-oriented language that truly targets objects. All functions and variables are encapsulated in classes.

As for what is an object and what is a class, I will not talk nonsense.

Explanations of these two concepts are provided in any object-oriented language textbook.

If you know what Java is, you will naturally be interested in what Java can do.

 

Before talking about what Java can do, let's first talk about the advantages of Java as a real object-oriented language.

First of all, since it is truly object-oriented, it is necessary to completely encapsulate

This is the biggest difference between Java and C ++. All Java source code and compiled files exist in the form of classes.

Java has no so-called external class definition. All functions (methods) and variables (attributes) must be defined inside the class.

In this way, a class will not be cut into one of the blocks here. c ++ is fine, isn't it?

This makes the entire program structure very clear and clear.

 

Second, the most exciting thing is that the pointer is completely blocked and the garbage collection mechanism is introduced.

Anyone who has ever written C/C ++ code will be deeply disgusted with memory management.

This makes it impossible for us to focus on what we care about.

However, we need to consider some internal tasks of the computer as a software engineer.

I think no one is willing to spend a lot of time on memory management. After all, we are not electronic engineers.

At this time, the advantages of Java are reflected, and it completely shields the memory management.

That is to say, if you write a program in Java, the memory overhead of any program you write will not be controlled by you.

At first glance, it seems that you are bound, but this is not the case.

Although your program cannot manage the memory, it reduces the speed.

However, your program is very secure because you cannot call a null pointer.

Unlike when I used to write C, I was afraid of null pointers all day long.

Of course, if you have a deep understanding of this line, you will find that Java cannot guarantee that the program will not call a null pointer.

However, it will avoid calling null pointers to the maximum extent.

This is already very good and secure. This is the most outstanding advantage of Java.

 

Third, the virtual machine is cross-platform, which is the biggest feature of Java.

Maybe everyone knows windows, but not everyone knows UNIX.

Like java, many people do not know what UNIX operating systems are.

I don't want to talk about UNIX applications. This is not the main thing, but I would like to say that most of the minicomputers

Workstations run on UNIX operating systems, such as Linux and Solaris.

Unix has one of the most notable features of stability than windows, which is like Cisco and Huawei.

Cisco's machines are slow but stable. Huawei's machines are fast but unstable.

I want to unload some of my documents. I think there is still a market on the server side.

In addition, Windows is very important. In the promotion of MS, I think everyone rarely sees the word "security ".

Because the Windows operating system is intended for PC users, the PC will crash when it crashes, and the restart will be a big deal.

The most common reason for the blue screen is that Ms does not have its own chip on the server end.

So it is a little hard to do the system. Java can be compiled on Windows.

And then run it on Unix. This is something C/C ++ cannot do.

 

So here, what Java can do is becoming clearer.

As mentioned just now, Java programs have a feature of Security

This security is designed for your system. The system will be particularly stable after the Java program is run.

It can also be used across platforms. Obviously, Java is mainly used on all platforms except Windows operating systems.

Such as mobile phones and servers

Think about it. If the program you write is running on a mobile phone, how many of the mobile phones use Windows?

Even if you use C/C ++, do you need to write a program for each mobile phone?

Exhausted, the cross-platform Java will not be used, so it can be compiled once and run at any time

Similarly, at the server end, if I want to provide a network portal site, such as Sina

If you write an application, the performance of the PC cannot meet the requirements of the number of concurrent sites such as Sina.

Then it needs to buy a server, so the server MS has no market, and windows is not safe.

In, we will buy a sun/IBM machine or HP, But no matter who the machine is.

It cannot be installed on Windows because Windows is too insecure and multi-core support is too poor.

If you want to write a program to run on such a machine

Do we develop on this machine? Of course not. Generally, programmers use PCs and windows

So what should we do? Write a program, and then get the server to compile and debug?

It is definitely not possible, so we want to find a language. After the program is compiled

After debugging on the PC and directly porting it to the server, we will not hesitate to select Java

Because in terms of cross-platform and security, Java is always the first choice.

 

OK. The following describes the disadvantages of Java.

 

This is a misunderstanding, just like a GOTO statement.

Java has also abandoned pointers. Although it seems to have slowed down, the hardware performance has doubled in the past two or three years.

Speed is no longer a concern, and for enterprise applications

Nothing is more important than security and stability. In other words, we can tolerate slowness, but cannot tolerate crashes and blue screens.

In addition, the larger the application type, the blurrier the disadvantage of this slowness.

This is because, when system projects become larger and larger, the performance of any link may affect the overall situation.

Security is especially important, and just like a GOTO statement

This overpursuing speed will bring irreparable and even inevitable losses to system development, error correction, and maintenance.

Leave the memory to the computer for management. This price is worth it.

We are not doing PC games, and there is no need to treat the memory consumption as a father-in-law.

 

Second, it is a misunderstanding. Many people even come up with the interface drawn by the Java swing control.

In fact, Java is not a good-looking method. idea is an IDE written in Java, which is quite beautiful.

But why is it ugly? It is because the swing control is a product of the UNIX era, and the swing control is close to the Unix interface.

Foreigners can see the Unix interface quite well. They grew up eating UNIX meals.

Unix has hundreds of meals. It is not as profitable as Ms, so it is not very friendly to the Chinese.

In addition, there is no company in China that is working on the operating system, so it looks not very pleasing to the eye

People who have played UNIX know that Unix has never been very good at Chinese support.

 

Third, I didn't expect it. Others added

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.