Exemplo 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
        }
Exemplo n.º 2
0
 public static int YasDegis(Celal par)
 {
     return(par.Yas = 30);
 }
Exemplo 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
        }
Exemplo n.º 4
0
 public static int YasDegis(Celal par)
 {
     return par.Yas = 30;
 }