Monday, September 19, 2011

JAVA preferred for n/w

JAVA is most preferred language for the n/w
Why not c/c++ is when we compile "X.C" it creates a "X.OBJ" file which is too similar to the code u written in C it includes the first statement has header file (stdio.h) so while running this code "X.OBJ" it goes to the main library (/tc/lib) it includes all the predefined functions of that header file into our code so this leads more complexity in the code(i.e if you write C program of 10 lines and stdio file contains 200 lines your total code size becomes 210 lines) that creates an "X.EXE" file this file has machine instructions suitable for (particular) processor and system (i.e MACHINE DEPENDENT).


Where as when u create a java file "X.JAVA" and compiling it creates a "X.CLASS" file (byte code-has byte code equivalent to source code) when programmers need particular class they should import a particular package, package contains classes and interfaces so this package will be acted as references to JVM(Java Virtual Machine) once "X.CLASS" file runs. JVM after finding classes and interfaces executes the code in java library and results will be substituted in the place of packages.
Thus, 1)size of the program will not be increased.
2)no wastage of memory (or) processor's time (i.e in n/w we generally share resources b/w computers when memory is too large it takes time to load) and the most important thing that JAVA BYTE CODES is MACHINE INDEPENDENT so once it is given to JVM it converts byte code into particular machine code (which is also needed during n/w sharing becuse we can't say that everyone will use same os or machine).

JAVA also solves security problems like,
  1. Eave's Dropping
  2. Tampering
  3. Impersonation
  4. avoids virus.