Basic CS-Networks [TCS Placement]: Sample Questions 118 - 119 of 133

Get unlimited access to the best preparation resource for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 118

Networks
Edit

Describe in Detail

Essay▾

What is point-to-point link?

Explanation

  • Physical links limited to a pair of nodes are called point-to-point links.
  • Point to point networks connect one location to other location.
Given the Image is Define the Point to Point Link

Question 119

Networks
Edit

Describe in Detail

Essay▾

Explain covariance and contra-variance in . NET Framework 4.0 give an example for each.

Explanation

  • In . NET 4.0, CLR supports covariance and contravariance of types in generic interfaces and delegates.
  • Covariance enables casting a generic type to its base types, that is, instance of type IEnumerable < Tl > can be assigned to a variable of type IEnumerable < T2 > where, T1 derives from T2.
  • For example,

IEnumerable < tring > str1 = new List < tring > () ;

IEnumerable < object > str2 = str1;

  • Contravariance allows assignment of variable of Action < base > to a variable of type Action < derived > .
  • For example,

IComparer < object > obj1 = GetComparer ()

IComparer < tring > obj2 = obj1;

  • . NET framework 4.0 uses Out keyword for covariance, while “in” is used for contra-variance.
  • Variance can be applied only to reference types, generic interfaces, and generic delegates and not to value types and generic types.

Developed by: