logo
logo
Sign in

How Java is Important in the World of Internet

avatar
antony

The Internet helped throw Java to the forefront of programming, and Java, in turn, has had a profound effect on the Internet. The reason for this is quite simple: Java enlarges the universe of objects that can move about freely in cyberspace. In a network, two very broad categories of objects are transferred between the server and your Personal computer: passive information and dynamic, active programs.

When you read your e-mail, you are looking passive data. Even when you download a program, the program’s code is motionless only passive data until you perform it.

However, a second type of thing can be transferred to your computer: a dynamic, self-executing program. Such a program is an active agent on the client computer, yet is started by the server. For example, a program might be providing by the server to display properly the data that the server is sending.

As desirable as dynamic, networked programs are, they also current thoughtful problems in the areas of security and portability. Prior to Java, cyberspace was efficiently closed to half the entities that now live there.

As you will see, Java addresses those fears and, by doing so, has opened the door to an exciting new form of program: the applet.

Java Applets and Applications

Java can be used to make two types of programs: applications and applets.

An application is a package that runs on your computer, under the operating system of that computer. That is, an application created by Java is more or less like one formed using C or C++. When used to create applications, Java is not much dissimilar from any other computer language. Rather, it is Java’s skill to create applets that makes it important.

An applet is an application intended to be transmitted over the Internet and executed by a Java-compatible Web browser. An applet is really a tiny Java program, dynamically downloaded across the network, just like an image, sound file, or video clip.

The important difference is that an applet is a brainy program, not just an animation or media file. In other words, an applet is a program that can respond to user input and dynamically change—not just run the same animation or sound over and over.

As exciting as applets are, they would be nothing more than wishful thoughtful if Java were not able to address the two fundamental problems associated with them: security and portability. Before ongoing, let’s define what these two terms mean relative to the Internet.

Security

As you are likely aware, every time that you download a “normal” program, you are risking a viral contagion. Prior to Java, most users did not download executable programs often, and those who did scanned them for viruses prior to execution.

Even so, most users still worried about the option of infecting their systems with a virus. In addition to viruses, another type of hateful program exists that must be guarded against. This type of program can gather private information, such as credit card numbers, bank account balances, and passwords, by searching the fillings of your computer’s local file system.

Java answers both of these anxieties by if that a “firewall” between a networked application and your computer.

When you use a Java-compatible Web browser, you can securely download Java applets without fear of viral infection or malicious determined. Java achieves this protection by restraining a Java program to the Java execution environment and not allowing it.

The ability to download applets with confidence that no harm will be done and that no security will be broken is considered by many to be the single most important aspect of Java.

Portability

As discussed earlier, many types of computers and operating systems are in use through the world—and many are linked to the Internet. For programs to be animatedly downloaded to all the various types of stages connected to the Internet, some means of generating portable executable code is needed. As you will soon see, the same mechanism that helps safeguard security also helps create portability. Indeed, Java’s solution to these two problems is both stylish and efficient.

Java’s Magic: The Byte code

The key that allows Java to solve both the security and the portability problems just labelled is that the output of a Java compiler is not executable code. Rather, it is byte code. Byte code is a highly enhanced set of instructions designed to be executed by the Java run-time system, which is called the Java Virtual Machine (JVM). That is, in its standard form, the JVM is a translator for byte code. This may come as a bit of an astonishment. As you know, C++ is collected to executable code. In fact, most modern languages are intended to be compiled, not interpreted—mostly because of performance concerns. However, the fact that a Java program is performed by the JVM helps solve the major problems associated with downloading programs over the Internet.

Translating a Java program into byte code helps makes it much stress-free to run a program in a wide variety of environments. The reason is straightforward: only the JVM needs to be practical for each platform. Once the run-time package exists for a given system, any Java package can run on it. Remember, although the details of the JVM will change from platform to platform, all interpret the same Java byte code.

If a Java program were compiled to native code, then dissimilar versions of the same program would have to exist for each type of CPU linked to the Internet. This is, of course, not a possible solution. Thus, the clarification of byte code is the easiest way to create truly portable programs.

The fact that a Java program is interpreted also helps to make it protected. Because the execution of every Java program is under the control of the JVM, the JVM can contain the program and avoid it from generating side effects outside of the system. As you will see, safety is also improved by certain restrictions that exist in the Java language.

When a program is understood, it generally runs considerably slower than it would run if compiled to executable code. However, with Java, the change between the two is not so great. The use of byte code enables the Java run-time system to perform programs much faster than you might expect.

Although Java was designed for interpretation, there is technically nothing about Java that prevents on-the-fly gathering of byte code into native code.

Along these lines, Sun supplies it’s Just in Time (JIT) compiler for byte code, which is comprised in the Java 2 release. When the JIT compiler is part of the JVM, it compiles byte code into executable code in real time, on a piece-by-piece, request basis. It is important to understand that it is not possible to compile a whole Java program into executable code all at once, because Java performs various run-time checks that can be complete only at run time. Instead, the JIT compiles code as it is needed, through execution.

However, the just-in-time method still yields a significant performance boost. Even when dynamic compilation is applied to byte code, the movability and safety features still apply, because the run-time system (which performs the compilation) still is in charge of the execution atmosphere. Whether your Java program is really interpreted in the traditional way or compiled on-the-fly, its functionality is the same.

collect
0
avatar
antony
guide
Zupyak is the world’s largest content marketing community, with over 400 000 members and 3 million articles. Explore and get your content discovered.
Read more