Java program features

Platform-Independent

Many novices confuse here. They simple say, "because Java can be executed on any platform, Java is known as platform-independent language". It is totally a wrong conception, they understood in colleges. If the definition is correct, then almost I can prove every language is platform-independent. For example, you know well that C-lang can be executed on Linux and DOS (two languages). Then do you call C-lang as platform-independent? No, never. Then what is the correct meaning.

 

Portable

What made Java platform-independent? The .class file of Java contains bytecode (C-lang, .exe file contains binary code) and this bytecode makes Java platform-independent. That is, while you develop a software product in Java in your software company, just compile on the platform available in the work place. Then port it or carry the .class file to any client and execute it without bothering what platform (operating system) the client is loaded with. This is known as portability.

Object-Oriented

All the three OOPs concepts, encapsulationinheritance and polymorphism, are supported by Java.

  • With encapsulation, one instance variable can be given multiple values.
  • Reusability of code is maximum with inheritance and composition.
  • Same method gives different outputs when executed at different times is known as polymorphism and Java takes advantage of it.

Architecture Neutral

Java source file compilation results in an executable file known as .class file. .class file contains bytecode. Bytecode includes some square boxes, unknown and unreadable characters, some scattered English characters and this bytecoe is not in understandable format to Microprocessor. The bytecode is converted by the JVM (execution part of JDK) into binary code understood by that particular OS. The same bytecode is converted into different binary formats that can be executed by the underlying OS architecture. Java programs does not depend on the architecture of OS. Just load a compatible JDK for the OS.

 

Robust

Robustness means user friendliness of the language. Java does not allow the user to commit mistakes to the maximum extent.

  • Unassigned variables do not take garbage values.
  • Strong-type checking of variables and objects including in casting operations.
  • Does not allow to give the size of the array in array initialization. In C/C++, it is optional.
  • Comes with very effective exception handling mechanism added with extra features in JDK 1.7.
  • Java eliminates many memory management functions.
 

RESOURCES;