Science & Technology

Rant

Beauty of Java : Mapping Java objects to the real world

Posted 4 months ago|0 comments|318 views
JavaTM : Programming
VIDEOS
Written by
gauravsak
India
Hi folks,

This is my first post on RantRave
As most of you must be knowing, Java has been a powerful language since generations. But have you ever wondered why it is so attractive!

The Beauty of Java lies in its mapping of objects to the real world. The syntax that this language uses is so much closer to spoken English that I strongly feel it has far surpassed the publicity that C++ or for that matter many other Object oriented languages have achieved.

Let us illustrate this with an example. Suppose I want to write a simple class representing a real world Car in Java, I would write as simple as:


public class Car {

private String model;
private String make;
private String carType;

public void drive() {
The car goes vrrrrrruuuuummmm.....
}
};

Here we can see that the variables represent the properties of the real world car and the function drive maps to the behavior of the car.

I even feel that even if one does not understand the details of programming, he can still pick up Java easily because of its readability. The power of Java also lies in its naming conventions which clearly describes the purpose of each and every member of a class.

Wish you a fruitful experience with Java.

Regards,
Gaurav
EMAIL|FLAG THIS POST
COMMENTS

There are no comments for this post.
Sign in or sign up to post a comment.