正在加载图片...
Polymorphism J EXample void loan check in(LibMat& mat) mat.check inO if (mat is late) mat assess fine( if (mat. waiting listo matnotify available Since libat is an abstract base class and there are only real objects of class Renta/Book or Magazine in the program how could mat be instantiated and referenced?Polymorphism ◼ Example void loan_check_in(LibMat& mat) { mat.check_in(); if (mat.is_late()) mat.assess_fine(); if (mat.waiting_list()) mat.notify_available(); } ◼ Since LibMat is an abstract base class, and there are only real objects of class RentalBook or Magazine in the program, how could mat be instantiated and referenced?
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有