Thursday, 5 July 2012

JAVA OBJECTS.

JAVA IS OBJECT ORIENTED PROGRAMMING LANGUAGE AND ALSO PLATFORM INDEPENDANT.


WHAT IS AN OBJECT?
ANYTHING IN WORLD CAN BE IDENTIFIED BY OBJECT.
LIKE A CAR IS AN OBJECT IT HAS PROPERTIES LIKE FOUR STROKE ,AUTOMATIC GEAR SYSTEM LIKEWISE...


Real-world objects share THREE characteristics:
1.STATE 


EXISTING CURRENT INFORMATION ABOUT OBJECT ATTRIBUTE KNOWN AS 'STATE'
EX.WT=60KG,....ETC


2.BEHAVIOR


IT IS ALLOWING OPERATION'S ABOUT OBJECT STATE.
EX.IN BANK ACCOUNT IF YOU HAVE ZERO BAL THEN ATM WILL NOT ALLOW TO WITHDRAW MONEY FROM ATM.


3.UNIQUE IDENTITY
EVERY OBJECT HAS IT'S OWN UNIQUE IDENTITY.


ADVANTAGES OF OBJECT'S:

  1. Modularity: The source code for an object can be written and maintained independently of the source code for other objects. Once created, an object can be easily passed around inside the system.
  2. Information-hiding: By interacting only with an object's methods, the details of its internal implementation remain hidden from the outside world.
  3. Code re-use: If an object already exists (perhaps written by another software developer), you can use that object in your program. This allows specialists to implement/test/debug complex, task-specific objects, which you can then trust to run in your own code.
  4. Pluggability and debugging ease: If a particular object turns out to be problematic, you can simply remove it from your application and plug in a different object as its replacement. This is analogous to fixing mechanical problems in the real world. If a bolt breaks, you replace it, not the entire machine.
OBJECT'S NEED DYNAMIC MEMORY TO REPRESENT THE DATA USING NEW( ) OPERATOR.

No comments:

Post a Comment