Extending the question asked in Initializing an Interface? , we do instantiate an Interface while initialize it with implemented class.
My question is why in the first place, we are instantiate it with the Interface? Why can't I directly instantiate it with implemented class? For eg. :
Doc mydoc = new SimpleDoc();
Where Doc is interface and SimpleDoc is implementing it. What is the problem with SimpleDoc mydoc = new SimpleDoc(); Where this will fail?