Introduction
Programming with traditional language such as COBOL, PASCAL, FORTRAN, and C in referred as procedure oriented programming (POP). In a procedure-oriented approach, the primitive emphasis is on writing algorithm. We are least bothered about data members. If a program becomes very lengthy, complex and complicated we divide the entire program into smaller sub programs or sub routines. These sub-programs are commonly referred procedures or functions.
The major draw back of POP is
- Data lacks security
- Too many mass untangled jumps
which makes it difficult to debug a program. In a POP, most of the procedures or functions share global data. Once you define global data, it is free to the entire system. All the functions and procedures designed by you can manipulate the global data as and when they like, due to which they lack security.
To overcome the above drawback, people invented an alternate set of languages referred as OOP’s, OOP’s treats the data as a very critical element and does not allow it to move freely around the system. In OOP’s our major emphasis is on data members. We are least bothered about algorithms. Several OOP’s languages have been designed some of which are small talk, objective, C, C++, VC++, Java, etc…
The major demerit of C and C++ programs is that they are targeted only to the Intel processor. If you take a C and C++ program and dump it on any other processor they fail. To overcome the above drawback, people wanted to design a new software which when loaded on any processor having any kind of operating system, should work. The result was the birth of Java.
Most of the people have a misconception that Java has been designed for the Internet. The primitive object of designing Java was to be architecture-neutral / platform-independent. In between Internet acclaimed many booms. Internet is the only location where you find different breeds of computers communicating with each other and Java is such a software which when loaded on any machine would work. Hence people brought Java for Internet.
Java was introduced way back in the year 1991 at SUN Microsystems. Initially named OAK was latter renamed to Java in the year 1995. The credit of designing Java is not a single person’s effort, but teams effort conceived by
- James Gosling.
- Patrick Naughton.
- ED Frant.
- Mike Sheridan.
- Chris Warth.
- Simple: Java is considered as simple because most of the syntax’s come from the language C, and the object oriented principles come from C++. People who have minimal knowledge on C and C++ easily work out with Java.
- Object oriented: Java has acquired almost all the object-oriented capabilities from C++ (it supports all its OOP’s principles like Encapsulation, Inheritance, and Polymorphism). OOP’s treats data as a critical element and does not allow it to flow freely around the system.
- Robust: Java Robust enough to handle any kind of situations. Java’s Robustness can be seen in two major area
- Memory Management Mistakes: Management of memory is a sensitive issue for a programmer point of view. In traditional languages such as C and C++ a programmer must manually allocate and free all dynamic memory. Some times this may lead to problems, such as programmer might forget to free memory that was previously allocated or worst he might free some other memory which is still being used by some code. Java virtually eliminates such problems by managing memory allocation and de allocation for you.
- Error Handling: Basically there are two types of errors namely (1) Compile time error. (2) Run time error. Compile time errors are mostly generated due to wrong syntax’s and can be easily rectified. On the other hand Run time errors can be generated due to wrong logic’s which some time lead to abnormal program termination in languages such as C. Java handles such situations very efficiently without resulting to abnormal program termination.
- Multi-Threading: (used for Network Programming) Multi tasking can be classified into the following
- Process based and
- Thread based multitasking.
A process-based multitasking is one when you say the process executes two or more programs simultaneously. A thread-based multitasking is one in which same program performs more than one task simultaneously. Multithreading is a specialized form of thread based multitasking.
- Architecture neutral/Platform independent: A central issue for the Java designers was the code of longevity and portability. Most of the problems faced by the programmers are that there is no guarantee that if you write a program today, it will run tomorrow even on the same machine. Java overcomes this by giving you a slogan “WRITE ONCE RUN IT ANYWHERE, ANYTIME FOREVER”.
- Distributed: Originally network programs were developed using languages C and C++. It is very difficult to build Network applications using this language. Java simplifies the task for creating Network programs in a very easy manner. Even a novice programmer who has knowledge of Networking can easily develop Network programs.
When you compile C and C++ source code, the result is direct executable (.exe). Which can understood only by the Intel processor. When you compile a Java source code, the result is not a direct executable, you get a intermediate file referred as the byte code file (.class). This byte code can run on any system that having any kind of processor provided the system is J.V.M (Java Virtual Machine) enabled. J.V.M is Java run time system. Its functionality is to read the instruction from byte code file and convert it into native codes understood by processor.
Basically in Java you can build two types of applications
- Application programming.
- Applet programming.
Application programming will be similar to programs written in language such as C and C++. These are also referred as “console based application”. On the other hand Applets are mostly used for designing ‘GUI’ based Applications, which extend the functionality of web-browsers.
For designing Java Applications you can use one of the following editor’s.
- Symantic Visual Cafe.
- Oracle Jbuilder.
- Notepad.
- MS-Dos Editor.
