Easy to Learn Java: Programming Articles, Examples and Tips

Start with Java in a few days with Java Lessons or Lectures

Home

Code Examples

Java Tools

More Java Tools!

Java Forum

All Java Tips

Books

Submit News
Search the site here...
Search...
 
Search the JavaFAQ.nu
1000 Java Tips ebook

1000 Java Tips - Click here for the high resolution copy!1000 Java Tips - Click here for the high resolution copy!

Java Screensaver, take it here

Free "1000 Java Tips" eBook is here! It is huge collection of big and small Java programming articles and tips. Please take your copy here.

Take your copy of free "Java Technology Screensaver"!.

Java is better than .NET! part I

JavaFAQ Home » Good To Know Go to all tips in Good To Know


Bookmark and Share

Is Java better than .NET or not, it is up to you to decide after you read all the facts below...

By Partha Goswami

Different between each other, Java and .NET are both programming languages that present different technical characteristics. Much has been said on these two  languages so let us have a closer look and a side-by-side correlation.

Java

Java history began at 1990 when James Gosling , Bill Joy and other programmers at Sun Microsystems began developing a language called Oak. The main goal was to control microprocessors embedded in consumer items such as cable set-top boxes, and VCR's. By the year 1995, Java technology was released to a select group on the Web site http://wicked.neato.org . Java technology was officially born.

Main Advantages in Java Language:

  • Object oriented
  • Compiled and interpreted
  • Platform independent
  • Robust and secure
  • Distributed
  • Familiar, simple and small
  • Multithreaded and interactive.
  • High Performance
  • Dynamic and Extensible.

These are just the main Topics on this tool. Now, let us have a better look on how each one of these matters.

1. Object oriented:

  • Java is completely Object oriented.
  • Every java program requires at least the presence of one class, meaning an object-oriented feature.
  • Moreover, Java's official language definition itself includes the term object-oriented.

2. Compiled and interpreted:

The main reason to state that Java is Compiled and interpreted is because:

  • Source code is compiled into bytecode (low-level, platform independent code)
  • Bytecode is interpreted (real machine code produced at run time)
Such features make it fast and portable.

3. Platform independent:

 With Java the problem of platform-independence is solved by using byte code. This code will look similar to this:

CA FE BA BE 00 03 00 2D 00 3E 08 00 3B 08 00 01 08 00 20 08

Since this code will be the very much the same on every machine one can perfectly state that Java is Platform independent!

4. Robust and secure

Java supplies both extensive compile-time type checking as well as run-time  checking. Java also combines many security features, both in the language itself and in  the run-time environment, which will protect applications written in Java. Because the language is interpreted, this maximizes its portability and dynamic capabilities by creating bytecodes which will execute on any platform.

Let us imagine a program that accomodates a virus and accesses the local files in the system. Java doesn't allow that unless you give the applet permission to  access your local files and approval through the policy tool. An applet can't  call .dll(dynamic linked library) files also.

5. Distributed:

Java is built to support applications on networks. Java allows various levels of network connectivity through classes in java.NET. These classes allow you to connect to a specified port on a named Internet host and read/write data, or simply implement a server to accept connections from clients.

6. Simple, small and familiar

Java enables the conception of a small and simple language that nevertheless is still sufficiently comprehensive to attend a large spectrum of software application development. In one hand, the number of language constructs required to get a certain task done is quite minimal.

In the other hand, Java is in a way similar to C and C++ but rejects the consuming complexities of those languages. Let us consider the next example:

A Java program with multiple classes:

Code:


Class Room{
    float length ;
    float breath ;
   
    void getdata(float a, float b){
       length =a ;
       breath =b;
    }

Class Room Area{
   
    public static void main(string args [] ){
        float area ;
        Room room1 =new Room (); // create an object room1
        room1. getdata(14,10);
        area =room1.length * room1. breadth ;
        system.out.println("Area="+area);
    }
}

7. Multithreaded  and interactive:

Java is multithreaded which means that in an application many Java objects can run simultaneously. Programming in Java with threads will be more convenient than programming in the common single-threaded C and C++ kinds.

Also, Java runtime comes with tools that support multiprocessing synchronization and build a smooth running interactive system.

8. High Performance:

Java has a high performance as it assumes a scheme by which the interpreter can run at full speed without needing to check the runtime background. It has its own way to ensure high memory.

9. Dynamic and Extensible:

We can state that java is completely dynamic as the language and runtime system are dynamic in their linking stages. Through dynamic binding, Java applets can be adjusted without recomposing the whole application.

Java programs move all around the Internet and execute on the user's local computer; they allow a certain number of dynamic behaviors impossible in former style systems.

Also, Java is extensible. It provides a platform for customized knowledge-based applications. Java is extensible by specifying your own program aspects, one can do an applet act differently from its author main intentions.

.NET

will be continued...


 Printer Friendly Page  Printer Friendly Page
 Send to a Friend  Send to a Friend

.. Bookmark and Share

Search here again if you need more info!
Custom Search



Home Code Examples Java Forum All Java Tips Books Submit News, Code... Search... Offshore Software Tech Doodling

RSS feed Java FAQ RSS feed Java FAQ News     

    RSS feed Java Forums RSS feed Java Forums

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest 1999-2006 by Java FAQs Daily Tips.

Interactive software released under GNU GPL, Code Credits, Privacy Policy