Statement: You can store the reference to any object instantiated from any class that implements an interface in a reference variable of that interface type. I understand that I can do it. What I would like to know is why would I want to do it. What is the advantage to using an interface reference instead of an object one?
I know that in java all basic data types are pass by value and objects are pass by reference, but now i am wondering why such decision was made (even by james gosling) .they could have even made basic data types pass by reference or made even objects as pass by value.