| Back |
|
Is Java just another programming language?
Yes it is, but the more accurate answer is - Java is a programming environment that is
platform-independent, object-oriented, and multithreaded. What does it mean by platform-independent? It means, once you write your program, and compiled it, you can put the compiled piece at any computer that run any operating system, and run your program there. Your piece of codes can run on Windows 98/2000/NT, and it can also run on Unix. Which means, you don't have to rewrite your codes for specific operating system. You just write once, compiled once, and run anywhere! How does Java accomplishes this? When you compiled your java program, byte codes results. To run the program, you need the Java virtual machine, which is installed on the machine where you want to put your byte codes on. The Java virtual machine can interpreted this bytes codes, no matter what platform it is installed on. What is object-oriented? Object-oriented means, you write your codes based on objects. When you want to begin writing codes, you will think of objects. You will thinks of what objects does exist that compliments to your program. Then, you will start writing codes for that object. Therefore, you are creating object first (by writing codes for that object), and when you finishes creating all the required objects for your program, you will use the objects like they are interacting with each other. I will discuss more on this in the next topic. Java is multi-threaded A thread is actually a piece of program, and it is allowed to run in it's own process space. Then, you will have another thread, which is a piece of program (also), and it is running in it's own process space. And... Well, it does can continues ... forever... So, you can have many threads, or programs and they are running simultaneously, and independent of each other. And more interesting is, they can share the same resource in your program, and they can interact with each others. |