Exemplo n.º 1
0
        static void Main(string[] args)
        {
            EncapClass obj2 = new EncapClass();

            Console.Write("\n\nEnter your year : ");
            int g = int.Parse(Console.ReadLine());

            Console.Write("Enter your name : ");
            string n = Console.ReadLine();

            obj2.setValue(g, n);
            Console.WriteLine("Hello  " + obj2.getName());


            Task02Encap obj3 = new Task02Encap();

            Console.Write("\nEnter first subject marks : ");
            int number1 = int.Parse(Console.ReadLine());

            Console.Write("Enter second subject marks : ");
            int number2 = int.Parse(Console.ReadLine());

            obj3.setNumbers(number1, number2);
            obj3.findSum();

            Console.ReadKey();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            EncapClass ec = new EncapClass();

            ec.setAge(25);
            Console.WriteLine("Your Age is " + ec.getAge());
            Console.ReadLine();
        }