Prerequisites of java



C  and C++.
why java is important for internet?
                                Java has evolved to be the most popular general purpose programming language of the current age. Java plays a significant role in the corporate world. Companies of all sizes are using Java as the main programming language to develop various applications/projects worldwide. It has found its use in various sectors including banking, insurance, retail, media, education, manufacturing and so on.  E-commerce, Gaming, Mobile, Embedded, Media and many more types of applications are being developed using Java.
                Why java is suitable for internet is, because of two reasons. 1. It is system independent and hence its programs can run on any type of computer system available on internet.
2. It eliminates a lot of security problems for data on internet.
Let us discuss the above points.
Suppose if we are writing a C program with name Demo.c  , as per our requirement. When we compile this program , we get Demo.obj file that contains machine language code and that file contains first statement to include a header file like <stdio.h>.when we run the program, C complier  to the  C standard library and searches for the header file <stdio.h> there. When it found, C compiler copies the entire code from the header file into Demp.c  program. So if we write a C program of 10 lines and the <stdio.h> file contains 100 lines, then the total size of the file will be 110 lines. This file is called Demo.exe file. This file contains machine language instruction which are understandable to the microprocessor. So it execute them and gives the results.

Demo.c
Demo.exe
output
Demo.obj



                                The above diagram represents execution of c program.
we have many operating systems like Dos, linux, unix…etc  and every operating system stores the data and instructions in different formats. So if we created an .exe file in C or C++ on X processor and Y Operating system, then we execute it on X processor and  Y operating System only. If the processor or operating system is changed, then it is not possible  to execute the same code. They cannot be executed on a different configuration. So they are called system dependent languages.
As we know that internet is  a global network of all the computers existing on the earth and anyone can connect his/her computer to internet. So there will be different types of computers with different configuration. So if we develop a software in c or c++ like languages,  that software can be distributed on the internet and people can download the .exe files, but they cannot run those files because of their system dependence. So c/c++ are not suitable to develop software for internet.
In java ,if we write a program, it is stored with an extension .java. let us say x.java. it contains source code statements. If we compile that program, java compiler first translate the x.java into x.class file. And this file contains  byte code instructions.
But the microprocessor cannot understand the byte code instructions. In java we hava JVM(java virtual machine), it can understand the byte code instructions and covert them into machine code. We will discuss about JVM in next class.


x.java
JVM
output
x.class



Java program              byte code                        jvm converts byte code into machine code
JVM understands the operating system in the computer and accordingly it forms the instructions. So there will not be any problem for the operating system with a different processor.   
So if we created an .java program on X processor and Y Operating system, then that program is executable on any other computer system with any  processor and   operating System .  this means  java programs are system independent.
On internet , different computer systems with different processors and different operating systems are available, but still java programs will run any system and produce the same results on all the systems.
If we developed a software in java language, the .class files are downloaded from internet and  can be executed on any other system without any problem. Hence java is suitable for internet.
Q: what is the difference between .exe and .class file?
A:   .exe file contains machine language instructions for the microprocessor and is system dependent. .class file contains byte code instructions for the jvm and is system independent.
Internet is public network, everyone can connect their computers into internet and this leads to several security problems. For example if we are sending  a message to a friend. Now this message will go through millions of servers on internet before reaching the destination computer. In between anybody can see the data of the message. Let us discuss some major security problems for data on internet.
 hacking :  means stole the others data without their permission.
Eavesdropping: means reading others data illegally on internet. For example opening others emails and reading them. The solution for this problem is encryption and decryption. Converting data into and unreadable format is call encryption and getting back the original data from the encrypted format is call decryption.  Encryption and decryption can be done by java technology.
Impersanation:  means  a person  acting himself as another person on internet. Many people hide their original identity  and act as somebody else to make transactions. The solution for this problem is digital signature. Digital signature is a file that contains personal identification information in an encrypted format. It can be created using java tech.
Tampering:  means not only reading other data but also modifying . encryption and decryption is the solution for this problem.
Virus: it represents  a program that can cause harm to the data, software and hardware of system. Most of the viruses spread with .exe ,.doc,images , audio and videos files. Viresus cannot spread with .txt file. In java .class file, which are similar to  .txt files and there is no chance of virus affecting  these files.

From the above problems , we can say that java  can eliminate the above security problems that often occur on internet.

No comments:

Post a Comment

Genuine websites to earn money.

If you are interested in PTC sites then this article is for you. I have personally tried many of the sites and found that the best thing ...