下载此文档

常见英文面试笔试题目.doc


文档分类:管理/人力资源 | 页数:约12页 举报非法文档有奖
1/12
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/12 下载此文档
文档列表 文档介绍
: .
C/C++ Programmi ng in terview questi ons and
an swers
By Satish Shetty, July 14th, 2004
What is encapsulation??
Containing and hiding information about an object, such as internal data structures and code. Encapsulation isolates the internal complexity of an object's operation from the rest of the applicati on. For example, a clie nt comp onent ask ing for net revenue from a bus in ess object n eed not know the data's origi n.
What is inheritance?
Inheritance allows one class to reuse the state and behavior of another class. The derived class inherits the properties and method implementations of the base class and extends it by overriding methods and addi ng additi onal properties and methods.
What is Polymorphism??
Polymorphism allows a clie nt to treat differe nt objects in the same way even if they were created from differe nt classes and exhibit differe nt behaviors.
You can use implementation inheritance to achieve polymorphism in Ianguages such as C++ and Java.
Base class object's poin ter can in voke methods in derived class objects.
You can also achieve polymorphism in C++ by fun cti on overloadi ng and operator overloadi ng.
What is constructor or ctor?
Constructor creates an object and initializes it. It also creates vtable for virtual functions. It is differe nt from other methods in a class.
What is destructor?
Destructor usually deletes any extra resources allocated by the object.
What is default constructor?
Con structor with no argume nts or all the argume nts has default values.
What is copy constructor?
Con structor which in itializes the it's object member variables ( by shallow copy ing) with ano ther object of the same class. If you don't implement one in your class then compiler implements one for you.
for example:
Boo Obj1(10); // calling Boo constructor
Boo Obj2(Obj1); // calli ng boo copy con structor
Boo Obj2 = Obj1;〃 call ing boo copy con structor

常见英文面试笔试题目 来自淘豆网www.taodocs.com转载请标明出处.

非法内容举报中心
文档信息