casting is the technique using which we convert data of one
type to data of another type.
It is like a main category of boxing.
boxing is a sub category of casting which deals with
converting a value type to a reference type.
1) double d=245.66;
//casting: conversion between 2 value types
2) int f=200;
object z=f; //casting as well as boxing: conversion of a value type to a reference type.
Asked In: Many Interviews |