Page 51 - iPro_trackGPT_V5_Class8
P. 51
Java follows the Write Once, Run Anywhere (WORA) principle. This means that a Java program
can run on any device equipped with a Java Virtual Machine (JVM) without requiring any
changes. As a result, Java programs are not reliant on the specific hardware of the computer,
which makes Java a platform-independent language.
Java is designed to be simpler and more user-friendly compared to some other object-oriented
programming languages, such as C++, Ada and Smalltalk. The creators of Java aimed to
incorporate successful features from previous languages while addressing their shortcomings.
FEATURES OF JAVA
Some features of Java are as follows:
Easy to Learn: Java is simple and easy to understand, which is great for beginners.
Case Sensitive: Java is a case-sensitive language, which means uppercase and lowercase
letters are treated as different, so 'pay' and 'PAY' are not the same.
Object-Based: Java uses objects to help organise and run programs. These objects hold data
and can do things with that data.
Platform Independent: Java programs can run on any type of computer without needing to
be changed. This means you can write a program once and use it anywhere.
Safe and Secure: Java helps keep programs safe from viruses and has ways to protect data
using special codes.
Error-Resistant: Java tries to catch mistakes before the program runs and checks for problems
while it's running to make sure everything works well.
WHAT IS AN OBJECT AND A CLASS?
As we have discussed above, an object-oriented programming language uses objects and classes.
Let us discuss them in detail.
Object
An object is an instance of a class that represents a real-world entity, such as a telephone, mouse,
or bag. Each object has attributes (properties) and methods (behaviours). Attributes describe the
object's characteristics or state, while methods define the actions or functions it can perform. For
instance, a computer object might have attributes like brand name, type and price, and methods
such as performing calculations.
Class
A class is a user-defined blueprint or template used to create objects. It groups objects that
share similar attributes and methods. For example, a class called vehicle might include different
types of vehicles, such as cars, bikes, and trucks, each having common features like speed and
fuel type.
Vehicle
Car Bike Truck
Program Coding 49

