Hi everyone! What is the point in referencing an object using a different type?
Dissertation diss = new Dissertation(50); //Dissertation class implements IFlippable interface IFlippable fdiss = diss; //or Book bk = new Book(); Book bdiss = new Dissertation(); // Book is the base class for Dissertation //or IFlippable f1 = new Diary(1);
why not just do this:
Dissertation diss = new Dissertation(50); IFlippable fdiss = new IFlippable(); //or Book bk = new Book(); Book bdiss = new Book(); //or IFlippable f1 = new IFlippable (1);
what would the difference be?