Esempio n. 1
0
        static void Main(string[] args)
        {
            //Conversions
            Money   m               = new Money(42.42M);
            decimal amount          = m;
            int     truncatedAmount = (int)m;



            Calculator ca = new Calculator();

            Console.WriteLine(ca.CalculateDiscount(new Prodcut()
            {
                Price = 10
            }));
            Console.WriteLine(string.Concat("To box or not box", 42, true));

            Console.WriteLine("-----------------------------------");

            Celal cel = new Celal()
            {
                Yas = 35
            };

            Console.WriteLine(cel.Yas);

            Console.WriteLine(YasDegis(cel));

            Console.WriteLine(cel.Yas);
            Console.Read();

            Object       stream       = new MemoryStream();
            MemoryStream memoryStream = (MemoryStream)stream;
            double       x            = 1234.7;
            int          a;

            // Cast double to int
            a = (int)x; // a = 1234
        }
Esempio n. 2
0
 public static int YasDegis(Celal par)
 {
     return(par.Yas = 30);
 }
Esempio n. 3
0
        static void Main(string[] args)
        {
            //Conversions
            Money m = new Money(42.42M);
            decimal amount = m;
            int truncatedAmount = (int)m;

            Calculator ca = new Calculator();
            Console.WriteLine(ca.CalculateDiscount(new Prodcut() { Price = 10 }));
            Console.WriteLine(string.Concat("To box or not box", 42, true));

            Console.WriteLine("-----------------------------------");

            Celal cel = new Celal() { Yas = 35 };
            Console.WriteLine(cel.Yas);

            Console.WriteLine(YasDegis(cel));

            Console.WriteLine(cel.Yas);
            Console.Read();

            Object stream = new MemoryStream();
            MemoryStream memoryStream = (MemoryStream)stream;
            double x = 1234.7;
            int a;
            // Cast double to int
            a = (int)x; // a = 1234
        }
Esempio n. 4
0
 public static int YasDegis(Celal par)
 {
     return par.Yas = 30;
 }