rules of polymorphism in java