课程内容提要
C++ 语法要点
C++ 类与派生类的定义
类外定义函数体
构造函数与析构函数
对象指针与对象引用
虚函数
JAVA语法要点
类的定义
接口的定义
(1)interface
(2)void drawLine(double x1, double y1, double x2, double y2)
(3)void drawCircle(double x, double y, double r)
接口是一种特殊的类,只有定义,没有实现
试题1
考察接口的定义和实现
(1)void Insert(Department department)
(2)Department GetDepartment(int id)
(3)implements IDepartment
(4)implements IDeparment
(5)interface IFactory
(6)IDepartment CreateDepartment()
试题2
(1)interface
(2)void drawLine(double x1, double y1, double x2, double y2)
(3)void drawCircle(double x, double y, double r)
(4)DP1.draw_a_circle(x, y, r)
(5)DP2.drawcircle(x, y, r)
(6) abstract public void draw()
虚方法
本文链接: http://www.ionluo.cn/blog/posts/46219321.html
版权声明: 本作品采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可。转载请注明出处!