1. Difference between an array and a list:
Array is collection of homogenious elements.
List is collection of hetrogenious elements.
For array memory is allocated is static and continuous.
For list memory is allocated is dynamic and random.
Array: user need not to keep in track of next memory location.
List: user has to keep in track of next memory location where memory is allocated.
2. what is faster:
it's an array bcz it is continuous.
3. Define a constructor..........
Constructor is a member function of the class, with the name of the function being the same as the class name. It also specified how the object should be initialized.
Ways of calling constructor:
1. Implicitly : automatically by compiler when object is initialized.
2. Explicitly :calling the constructors explicitly is possible, but it makes the code unverifiable.
4. Describe private , protected and public..............
These keywords introduced in c++ to set the boundaries instructure or class. These access specifiers are used onlyin a class or structure declaration. Whenever you use an access specifier, it must be followed by colon.
Anyone can access the data members or functions that are declared in public mode.
No one can access the data members or functions that are declare in private mode except you, the creater of the type.
protected acts like private , with one exception that the next child also can access the protected data.