o
in
ob1
and
o
in
ob2
both refer to the same
X
object. Changing one affects both.
Of course, the
int
field
b
in each is still separate because the value types are not accessed via
references.
IFormatProvider and IFormattable
The
IFormatProvider
interface defines one method called
GetFormat( )
, which returns an
object that controls the formatting of data into a human-readable string. The general form of
GetFormat( )
is shown here:
object GetFormat(Type
fmt
)
Here,
fmt
specifies the format object to obtain.
The
IFormattable
interface supports the formatting of human-readable output.
IFormattable
defines this method:
string ToString(string
fmt
, IFormatProvider
fmtpvdr
)
Here,
fmt
specifies formatting instructions and
fmtpvdr
specifies the format provider.
Do'stlaringiz bilan baham: |