Home > Why Java? > Why Java?

Why Java?

 

 

Java owned by Sun Microsystems, Inc. is just another object oriented language which is easy to learn and easy to use. C and C++ have thier share of uses and users deservingly and Java takes it all to another level. It is not difficult for any C/C++ developer, or any object oriented/non-objected oriented developer to get hands on with Java. Various tutorials, crash courses are available all over the internet space for starting up with Java or migrating to Java from any other technology.

Java has lot to offer and that can be inferred by its wide use. It might be one of the reasons for many in trying to know “what is this Java all about anyway?”. It can be used from simple applications to enterprise business applications. Apart from the featurs that we discuss below, other reason is also that Java being free and an open-source software, many third party organizations have used / based Java to develop robust frameworks and high-end solutions for today’s real-time applications. From Sun’s own enterprise solution J2EE to various other server-side solutions, Java has been in the heart of many business applications today. Let’s try to explore why Java is what it is today.

Traditionally, software programs were being written in source code and then compiled into machine code that talks directly to the operating system on a computer. This means that traditional programs depend on, and are bound to, a particular platform. Porting from one platform, or operating system, to other, is traditionally time-consuming and prone to errors. The Java platform is a virtual platform that mitigates this dependency by providing a model in which software is written and compiled, and can then be transmitted over a network and run anywhere by a fully compliant virtual machine. This model provides the additional benefit of heightened security, both because programs can be verified by the client’s virtual machine after they have been transmitted over a network, and because the client’s virtual machine can run programs in a secure “sandbox” that prevents certain destructive behaviors.

Software programmers have embraced the Java platform because it reduces the cost and time required to write and support software code. They are no longer required to rewrite software to function on different computers with different operating systems. Companies and organizations deploying applications, favor Java technology because it minimizes the cost of purchasing or modifying different versions of software applications for the various types of computers and servers within their networks.

 

Sun Quotes:

To date, the Java platform has attracted more than 6.5 million software developers. It’s used in every major industry segment and has a presence in a wide range of devices, computers, and networks.

 

Few of the reasons for Java’s popularity:

  • Write software on one platform (Ex:-Windows) and run it on virtually any other platform (Ex:- Linux) anytime. (Write once, Run anywhere)
  • Create programs to run within a Web browser (Ex:- IE, Mozilla, Netscape, etc) to Web services (Web services, in naive terms can be said to be web-application++, using which any application can publish its function / method / message to the rest of the world).
  • Develop server-side applications for online forums, stores, polls, HTML forms processing, e-commerce and more. (Ex:- J2EE & lot of other open-source / free Java based frameworks can be used to write applications which can run on a server, serving multiple clients at the same time across the globe without any ado)
  • Write powerful and efficient applications for mobile phones, remote processors, low-cost consumer products, and practically any other device with a digital heartbeat. (Not just limited to desktop applications, web applications, web services, but various other modern day devices with extensive security and customization).

Since Java is an object oriented programming language it has following features:

  • Reusability of Code
  • Emphasis on data rather than procedure
  • Data is hidden and cannot be accessed by external functions
  • Objects can communicate with each other through functions
  • New data and functions can be easily added

 

Few of Java features:

  • Simple
  • Reusable
  • Portable (Platform Independent)
  • Distributed
  • Robust
  • Secure
  • High Performance
  • Dynamic
  • Threaded
  • Interpreted

 

Java is Distributed

With extensive set of routines to handle TCP/IP protocols like HTTP and FTP, java can open and access the objects across net via URLs.

Java is Multithreaded

One of the powerful aspects of the Java language is that it allows multiple threads of execution to run concurrently within the same program A single Java program can have many different threads executing independently and continuously. Multiple Java applets can run on the browser at the same time sharing the CPU time.

Java is Secure

Java was designed to allow secure execution of code across network. To make Java secure many of the features of C and C++ were eliminated. Java does not use Pointers. Java programs cannot access arbitrary addresses in memory.

Garbage collection

Automatic garbage collection is another great feature of Java with which it prevents inadvertent corruption of memory. Similar to C++, Java has a new operator to allocate memory on the heap for a new object. But it does not use delete operator to free the memory as it is done in C++ to free the memory if the object is no longer needed. It is done automatically with garbage collector.

 

Sun Quotes:

How Will Java Technology Change My Life?

We can’t promise you fame, fortune, or even a job if you learn the Java programming language. Still, it is likely to make your programs better and requires less effort than other languages. We believe that Java technology will help you do the following:

  • Get started quickly: Although the Java programming language is a powerful object-oriented language, it’s easy to learn, especially for programmers already familiar with C or C++.
  • Write less code: Comparisons of program metrics (class counts, method counts, and so on) suggest that a program written in the Java programming language can be four times smaller than the same program written in C++.
  • Write better code: The Java programming language encourages good coding practices, and automatic garbage collection helps you avoid memory leaks. Its object orientation, its JavaBeansTM component architecture, and its wide-ranging, easily extendible API let you reuse existing, tested code and introduce fewer bugs.
  • Develop programs more quickly: The Java programming language is simpler than C++, and as such, your development time could be up to twice as fast when writing in it. Your programs will also require fewer lines of code.
  • Avoid platform dependencies: You can keep your program portable by avoiding the use of libraries written in other languages.
  • Write once, run anywhere: Because applications written in the Java programming language are compiled into machine-independent bytecodes, they run consistently on any Java platform.
  • Distribute software more easily: With Java Web Start software, users will be able to launch your applications with a single click of the mouse. An automatic version check at startup ensures that users are always up to date with the latest version of your software. If an update is available, the Java Web Start software will automatically update their installation.

 

OOP Concepts

Object Oriented Programming is a method of implementation in which programs are organized as cooperative collection of objects, each of which represents an instance of a class, and whose classes are all members of a hierarchy of classes united via inheritance relationships.

Four principles of Object Oriented Programming are :-

  • Abstraction
  • Encapsulation
  • Inheritance
  • Polymorphism

Abstraction

Abstraction is the process of hiding the details and exposing only the essential features of a particular concept or object.

Encapsulation

Encapsulation is a programming concept that a language should support in order to separate an object’s state from its behavior. This is typically facilitated by means of hiding an object’s data representing its state from modification by external components.

  • Hides the implementation details of a class.
  • Forces the user to use an interface to access data
  • Makes the code more maintainable.

Inheritance

Inheritance is the process by which one object acquires the properties of another object.

Polymorphism

Polymorphism is the existence of the classes or methods in different forms or single name denoting different implementations.

Java Applications

Java has evolved from a simple language providing interactive dynamic content for web pages to a predominant enterprise-enabled programming language suitable for developing significant and critical applications. Today, It is used for many types of applications including Web based applications, Financial applications, Gaming applications, embedded systems, Distributed enterprise applications, mobile applications, Image processors, desktop applications and many more.

 

Want to learn more about Java and its features to see if it is worth while?

Vodpod videos no longer available.

 

Today, many colleges / universities / training institutes offer courses in programming for the Java platform. In addition, developers can also enhance their Java programming skills by reading Sun’s java.sun.com Web site, subscribing to Java technology-focused newsletters, using the Java Tutorial and the New to Java Programming Center, and signing up for Web, virtual, or instructor-led courses.

Vodpod videos no longer available.

 

Links:

http://java.sun.com/

 

Note: Refer to other posts in Java category for further knowledge.

 

 

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: