Languages-C & C Plus Plus [3i Infotech Placement]: Sample Questions 159 - 160 of 354

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 159

C & C Plus Plus
Edit

Describe in Detail

Essay▾

Can link and Association applied interchangeably?

Explanation

  • No, link represents the relationship between the two objects.
  • But Association is used represent the relationship between the two classes. link:: student: Abhilash course: MCA Association:: student course
  • Association is a relationship among classes and link is a relationship among instance of classes.
  • e. g. ⩾ Person works for company.
  • Connection between two classes ‘person’ and ‘company’ is an example of association. One instance of each of the above classes like ‘Ram’ and ‘Google’ will have a “link” : Ram is working for Google.
  • We can՚t use ‘Person works as a programmer for Google’ .

Question 160

C & C Plus Plus
Edit

Describe in Detail

Essay▾

What is function overloading and operator overloading?

Explanation

Define Parts of Compile Tme Polymorphism

Function Overloading:

  • Function overloading means that functions with same name can be defined with different parameters or different number of parameters.
  • Appropriate function is identified by the compiler by number or types of parameters.
  • Reduces the investment of different function names and used to perform similar functionality by more than one function.

Operator Overloading:

  • Operator overloading allows operators on user defined objects.
  • All overloaded operators provides syntactic sugar for function calls that are equivalent.
  • Without fundamental language changes, operator overloading provides a pleasant facade.

Developed by: