PART I
C h a p t e r 1 7 :
R u n t i m e T y p e I D , R e f l e c t i o n , a n d A t t r i b u t e s
477
PART IPART I
Show();
}
public int Sum() {
return x+y;
}
public bool IsBetween(int i) {
if((x < i) && (i < y)) return true;
else return false;
}
public void Set(int a, int b) {
Console.Write("Inside Set(int, int). ");
x = a;
y = b;
Show();
}
// Overload Set.
public void Set(double a, double b) {
Console.Write("Inside Set(double, double). ");
x = (int) a;
y = (int) b;
Show();
}
public void Show() {
Console.WriteLine("Values are x: {0}, y: {1}", x, y);
}
}
class AnotherClass {
string msg;
public AnotherClass(string str) {
msg = str;
}
public void Show() {
Console.WriteLine(msg);
}
}
class Demo {
static void Main() {
Console.WriteLine("This is a placeholder.");
}
}
This file contains
Do'stlaringiz bilan baham: |