| The java programming language is becoming | | | | nothing for the bum.But C++ was still complex |
| more and more popular each day. It is the | | | | with things like pointers, memory leak and multiple |
| language without which one cannot even hope to | | | | inheritence. The pointer |
| a land a job these | | | | concept was taken from C and it was very |
| days. But has somebody even wondered how | | | | messy! The pointer is special type of variable |
| this language came about? There are many | | | | that points to other variables. Since there was no |
| stories about, many books have been written. | | | | guidelines as to how to use |
| Here is my version (not approved by Sun | | | | these pointers, it was very easy loose track of |
| Microsystems).The java programming language | | | | them. In a typical two thousand lines program, |
| originated in Indonesia. It was meant to be used | | | | one would frequently end up with hundredes of |
| by the tourists that visit that country each year. | | | | pointers pointing |
| Why would tourists want to use computer? Well, | | | | to thousands, some of them are pointers and |
| these are no ordinary tourists. They are rich | | | | some just plain variables. Needless |
| tourists. Have | | | | to say this made a large program extremely |
| they not been rich, they would not travel half | | | | difficult to read and when the |
| way around the world to visit this | | | | programmer left for another company, they |
| place. Most people would be content to see just | | | | would have no other choice than |
| what is available near by. For | | | | to just throw away his program! It was |
| example, if you are a texan living in Dallas, you | | | | sometimes necessary to do this even |
| will visit the stockyards or may be the | | | | when the programmer was around and very |
| trinity river park. If you live in New Orleans area, | | | | much alive. This is because the pointers he |
| you would see st. mary's | | | | created inside his program had taken a life of |
| bayou. Once in your lifetime, one will probably | | | | their own and defy |
| visit Hawaii or Niagara. But | | | | every attempt to predict how the program |
| going to Indonesia and its islands, Bali, Java, etc is | | | | should behave. |
| not for the ordinary | | | | Memory management was also another weak |
| people. Anyway, coming back to the question | | | | point of C and C++. The programmer was |
| why these tourists need to use | | | | responsible for cleaning up the memory their |
| computer programs. They go there not just to | | | | program would allocate and use. |
| have fun and also get some work | | | | Failure to do so will result in a crash of the whole |
| done in a fun atmosphere as these people are | | | | computer.Multiple inheritence, though sparingly |
| very important people.From the very start java | | | | used, was |
| was supposed to be computer independent. That | | | | another feature of C++ which made a |
| means if | | | | programmer's life miserable. It, however, |
| you write a program in java in one computer, it | | | | had its use, especially in job interviews. This one |
| should run in all computers. | | | | question, they thought, |
| This was necessary because tourists bring all | | | | helped them separate the wheat from the |
| kinds of computers with them. | | | | chaff.But C++ still had some nice and simple |
| Some bring | | | | features, like inheritence, encapsulation, etc. They |
| Windows machine, some Apple mackintosh. | | | | are something one can describe in plain english, |
| Some of the affluent ones bring | | | | something one can explain to a layman. So the |
| Sun server workstations or even a super | | | | creator of java decided to take |
| computer.Before starting to create java they also | | | | the good features of inherience, encapsulation, |
| sought to see if there have similar | | | | and polymorphism from C++, |
| stuff done already. Even though they could find | | | | while discarding the bad features such as multiple |
| none, they found they can use | | | | inherience, pointers etc. |
| lots of feature from some existing laguages. One | | | | The memory management was |
| such language they found was C++. C++ was an | | | | improved in java where the programmer will not |
| advancement over the language called C. In fact, | | | | be held responsible for memory management. |
| ideas of | | | | They |
| C++ was already hidden in C. In that language, | | | | can clean up after themselves if they want to |
| one can increment a variable, | | | | get extra credit, but they do not |
| say i, by applying the ++ operator e.g. i++. This | | | | need to. Needless to say all these was great |
| would increase the value of | | | | news to the tourists in Indonesia!Java introduced |
| the variable i by one. If i had a value of 5, it | | | | lot of clarity in notations too. For example, in C++ |
| would make it 6, etc. | | | | they |
| What a vision!Anyway, coming back to C++, it | | | | would say class doctor:person to mean doctor is |
| made an important advancement over C by | | | | derived from person. |
| introducing the idea of a class. To understand | | | | It is obviously very cryptic. The same situation |
| class, one has to undestand | | | | can be expressed |
| structure which was already used in C. The | | | | in java as class doctor extends person , which is |
| structure is a group of variables. | | | | much easier to understand. But there are few |
| For example, you have a name, an address, age | | | | awkward stuff in java too especially when |
| etc. for any person. In stead of | | | | someone |
| using them separately, in C one can group them | | | | says class bum extends person (my last bum |
| together and call it a person. | | | | joke)!Java made an important contribution in the |
| The creator of C++ said there is no need to | | | | graphical user interface (GUI) area. |
| expose these variables (name, address, etc) to | | | | C++ was really lacking in expertise here. They |
| the outside world. They said these details should | | | | visual C++, but worked only on |
| be hidden | | | | windows environment. But it did not work in |
| from the outside world. They called this concept | | | | UNIX systems or mackintoshes. Just |
| encapsulation.Another important | | | | like other features of java, this was also |
| contribution of C++ was the concept of | | | | supposed to be platform independent. |
| inheritence. This concept can be best | | | | This was further necessary because one can put |
| explained by example. Let's go back to the | | | | some little GUI on a web page which can be |
| example of the person. A person is | | | | views over the internet. And one cannot control |
| very general concept. There can be many | | | | what kind of computers other will have.After a |
| different kinds of persons, e.g doctors, | | | | while, it was necessary to call programs from one |
| lawyers, teachers, or just a bum! But each of | | | | computer to another |
| these people have a name, an address, age etc. | | | | computer. To do this, they created J2EE. I am |
| Even a bum has all these. The creator of C++ | | | | not sure how they came |
| thought one can | | | | up with the name J2EE. The 'J' of J2EE, of |
| define a base class call person and other classes | | | | course, means "Java", and I can be |
| can be derived from it. In | | | | reasonably sure '2' stands for 'To'. But I do not |
| plain english, this would mean, a doctor is special | | | | know what the 'EE' part is all |
| kind of person, lawyer is | | | | about, probably some kind of extension. |
| another special kind of person. Now the common | | | | Or at this point they ran out of names to think |
| attributes of all these kinds of people can be put | | | | of. So they decided to |
| in | | | | have one of those just another vague |
| the person class and special attributes can be put | | | | acronyms.If you would like, you can also visit my |
| in the derived classes, e.g. | | | | home page. |
| hospital for the doctor, court for the lawyer, and | | | | |