Java Programming - Interesting aspects

Java - the name and the fame , arises from the one of the top software company, Sun Microsystems. Java programming language is muscling its way onto the Internet with powers beyond those of mortal computer languages. The technology represented by Java holds the promise of a totally new way of providing products and services to consumers and promises truth, justice and an effective way of programming the information superhighway.

Table of Contents

  • 1 Why a new language arised?
  • 2 What makes java popular? </ul> </div>

    1 Why a new language arised?

    Before the java, programming languages such as C, C++, Pascal ruled the world of programming. But there exist lot of disadvantages with them. They are, Platform Dependent A C or C++ program written in Win 95/ 98 will not run in Linux or unix systems. Memory Management A lot of problem arised in the case of memory management. Since the memory management is in the hands of programmer, he / she couldn't find the memory leaks and fix them properly. This consumes more time in writing the program System's low level accessing These languages provieds system's low level resources accessing such as RAM, HDD or even processor, which leads to write virus programs. But in some situations it is an advantage for these languages. Coding These languages are not every easy to learn too. Also requires lot of codings. Security It doesn't provide any security very effectively in the network systems Internet These languages although used in webs for server-side cgi scripts, but not effectively gives security.

    2 What makes java popular?

    Popularity of java is based on many aspects.
    • Purely Object Oriented
    • Platform Independent
    • Multi Threading
    • Memory Management
    • Internet Applications i.e Applets
    • Security
    • Be Friendly

    2.1 Purely Object Oriented

    Java technology is puerly object oriented technology and not object based, i.e every thing in the programming is considered as objects and nothing other than else. So it makes the programming easier and more understandable than the normal procedural programming such as C or Basic etc.Also have a look at the comparision between the object oriented programming languages such as C++, Java, Eiffel and Smalltalk at Eiffel Software.

    2.2 Platform Independent:

    Java program is write once and run anywhere. It is because, java compiler doesn't compiles the java program in to it's native code, but it comples into an intermediate form known as Class File. After the class file is created, java interpreter interpretes the class file and executes the code. So, from this it is known that, there's no need of seperate java compiler for every i.e every OS or processor. we need only java virtual machine, that is used to run the java program in the host OS.

    2.3 Multi-Threading

    In the current world which we live, composed of multiple works performed at the same time moment. Example, in a home a TV, a refrigerator , a DVD system can be made to run at the same time using the distributed power supply. So the same concept is used in multi-threading. We have a single memory resources, that we use for many processing within the java programming. An usual example is, hearing the music , while browsing the net and recording our speech. This sounds normal, and makes to think that it is normal in case of human, what is special in it? The answer is, computer is a machine and it can do only one process or work at a time. so making the computer to process many works using the single processor is known as multi-threading.

    2.4 Memory Management

    Memory Management, one of the assests of Java programming. Java takes control of the memory that should be allocated for the objects used in the program. Java has fixed size of datatype and those datatype don't vary according to the platfrom as in windows 16-bit sizeof( int ) is 1 byte and in windows 32-bit the sizeof( int ) is 2 bytes. Java has it's own garbage collector. Garbage collector is used to free the memory that are allocated for objects duing the execution of the program. when the reference to the object is removed or missed, then the object is considered to be null. So we can remove the object's memory out of scene and have space for newly creating objects. Memory Management makes the programmer to reduce the burden of worries about the memory leakage , as in the C or C++ programing languages.

    2.5 Internet and Networking Applications

    With Java technology, the Internet and private networks become your computing environment. Coupled with the power of networking, the Java platform is helping computer users to do things that were previously unimaginable. For example, users can securely access their personal information and applications when they're far away from the office by using any computer that's connected to the Internet; soon they'll be able to access tailored applications from a mobile phone based on the Java platform, or even use smart cards as a pass key to everything from the cash machine to ski lifts.

    2.6 Security

    The great question of this networked world is Security. How secure is our data from others in this internet world. Java answers this question very effectively. Java have lot of security restrictions.
    • Applets cannot create or read files from the host system
    • Applet cannot execute any binary files i.e exe file or object files
    • Java programs cannot access the system low level resources i.e such as processors. So this restricts writing a virus program.
    • Java program runs inside a JVM and not in the System, so cannot access the system resources.So in these ways the java provides more security

    2.7 Be Friendly

    Java program is considered to be neutral too. Java program can be made to couple with anyother programming languages such as C or C++. This is known as JNI , Java Native Interface. A java program can be converted to a C or C++ program and made as native excutable. Comparision Picture of Java with other languages: </col> </col> </col> </col> </col> </col> </col>
    Java Smalltalk TCL Perl C C++
    Object Oriented ../images/2010/12/fill.jpg ../images/2010/12/fill.jpg ../images/2010/12/fill.jpg ../images/2010/12/halfill.jpg ../images/2010/12/halfill.jpg ../images/2010/12/nofill.jpg
    Robust ../images/2010/12/fill.jpg ../images/2010/12/fill.jpg ../images/2010/12/nofill.jpg ../images/2010/12/fill.jpg ../images/2010/12/nofill.jpg ../images/2010/12/halfill.jpg
    Secure ../images/2010/12/fill.jpg ../images/2010/12/fill.jpg ../images/2010/12/fill.jpg ../images/2010/12/fill.jpg ../images/2010/12/nofill.jpg ../images/2010/12/nofill.jpg
    Interpreted ../images/2010/12/fill.jpg ../images/2010/12/halfill.jpg ../images/2010/12/halfill.jpg ../images/2010/12/fill.jpg ../images/2010/12/nofill.jpg ../images/2010/12/nofill.jpg
    Dynamic ../images/2010/12/fill.jpg ../images/2010/12/fill.jpg ../images/2010/12/fill.jpg ../images/2010/12/fill.jpg ../images/2010/12/nofill.jpg ../images/2010/12/nofill.jpg
    Portable ../images/2010/12/fill.jpg ../images/2010/12/fill.jpg ../images/2010/12/fill.jpg ../images/2010/12/fill.jpg ../images/2010/12/halfill.jpg ../images/2010/12/halfill.jpg
    Neural ../images/2010/12/fill.jpg ../images/2010/12/halfill.jpg ../images/2010/12/fill.jpg ../images/2010/12/fill.jpg ../images/2010/12/nofill.jpg ../images/2010/12/halfill.jpg
    Threads ../images/2010/12/fill.jpg ../images/2010/12/halfill.jpg ../images/2010/12/halfill.jpg ../images/2010/12/fill.jpg ../images/2010/12/nofill.jpg ../images/2010/12/halfill.jpg
    Garbage Collection ../images/2010/12/fill.jpg ../images/2010/12/nofill.jpg ../images/2010/12/nofill.jpg ../images/2010/12/fill.jpg ../images/2010/12/nofill.jpg ../images/2010/12/halfill.jpg
    Exceptions ../images/2010/12/fill.jpg ../images/2010/12/fill.jpg ../images/2010/12/nofill.jpg ../images/2010/12/nofill.jpg ../images/2010/12/nofill.jpg ../images/2010/12/halfill.jpg
    Performance High Medium Low Medium High High
    ../images/2010/12/fill.jpg - Feature exists ../images/2010/12/halfill.jpg - Feature Somewhat exist ../images/2010/12/nofill.jpg - Feature Doesn't exist References:
    • Comparision of Object Oriented Programming languages - Eiffel Softwares
    • The Java Language Compared - The Java Language Environment from Sun Microsystems.