Posts

Showing posts from July, 2013

Runtime Polymorphism in java

Runtime Polymorphism: -------------------------------------------------- --------------------------------------------------- Polymorphism is the foundation of Object Oriented Programming. It means that one object can be have as another project. So how does on object can become other, its possible through following Inheritance Overriding/Implementing parent Class behavior Runtime Object binding One of the main advantage of it is switch implementations. Lets say you are coding an application which needs to talk to a database. And you happen to define a class which does this database operation for you and its expected to do certain operations such as Add, Delete, Modify. You know that database can be implemented in many ways, it could be talking to file system or a RDBM server such as MySQL etc. So you as programmer, would define an interface that you could use, such as...public interface DBOperation { public void addEmployee(Employee newEmployee); public void modifyEmployee(int id, Em...