Sponsored Ad

Wednesday, June 1, 2011

Can we have Non Abstract Method in Abstract Class in C#

Yes, you can have non abstract methods in abstract class. Along with non abstract methods you can also have abstract methods in abstract class.

You can not directly use non abstract methods of abstract class, for the same you have to derive a class from abstract class and give new implementation of non abstract method in derived class.

In below example there is abstract class abstract_class_example which is having the non abstract method non_abstract_method_example.

 

using System;

namespace MyApp
{
    public class abstract_examples
    {
        public static void Main(string[] args)
        {
            Console.ReadLine();
        }

        //abstract class with non abstract methods
        public abstract class abstract_class_example
        {
            public void non_abstract_method_example()
            {
                Console.WriteLine("Non Abstract Method Example.");
            }
        }     
    }
}

Can a Class can be Derived from Abstract Class in C#

Yes, you can derive a class from abstract class the code is given below. write a abstract class with abstract function and drive a class from this abstract class and override the abstract method in derive class and give implementation. while calling this method you need to create instance of derive class only because parent class don't have any implementation.

Program Output

Code to derive a class from abstract class:

using System;

namespace MyApp
{
    public class abstract_derived_class
    {
        public static void Main(string[] args)
        {
            derived_class obj = new derived_class();
            obj.my_method();

            Console.ReadLine();
        }

        public abstract class abstract_class
        {
            public abstract void my_method();          
        }

        public class derived_class : abstract_class
        {
            public override void my_method()
            {
                Console.WriteLine("Derived Class Method.");
            }
        }
    }
}

Friday, May 27, 2011

Bechtel India Interview Questions and Interview Process for .NET

Required Position: SSEBechtel India

Required Technology: .NET, SQL, Windows Forms, OOPS

 

Bechtel is one of the top construction company and also located in gurgaon. One of my friend gone through the interview process of Bechtel India. He has gone through the following rounds of Bechtel.

1. Telephonic Discussion: The first round was telephonic discussion. The interviewer was matching the requirement with the candidate knowledge and experience.  The interviewer asked basic .NET questions, which includes questions from .NET architecture, web services, OOPS and SQL.

Sample Questions: Can we have two static constructor in a  class, Write a query to find duplicate records in a table. etc.

2. Personal Technical Discussion: This round held in Bechtel India office and they took 1.5 hours of interview. The interview was pure technical round and they asked questions from .NET, ASP.NET, C#, SQL, Web Services etc.

Example: How to call user control page event from parent page and vice versa.

3. Managerial Round: This was pure managerial round. The manager was trying to understand your understanding about company rolls and responsibilities. Then told about company , work process, growth plans etc.

4. Technology Head Round: This round was with the Bechtel technology head of gurgaon office and he asked few question like why you looking for change , what is your expectation etc.

 

Bechtel is construction company, they have internal websites and software products to help their construction business.  Company maintain ethical relationship and provide a good growth path. Bechtel have 8.5 hours of working and if you work any extra hours, will get paid.

Sponsored Ad

Related Interview Questions



Followers

Follow Us