Difference between Constructors and static constructors?

Answer Posted / venkataramakrishna. danduri

The main thing is the constructoe can't be Static, int or
any other data type. It will simpley throws a error
messgae. It is just to confuse the candidate.

Example:
class A
{
public:
static A(){ a = 0;}
int a;
};

void main()
{
A a;
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by static variables?

843


what is data abstraction in C++?

836


Explain class invariant.

770


What do you mean by inheritance in c++?

817


Can create new c++ operators?

758


If a function doesn’t return a value, how do you declare the function?

814


Describe the role of the c++ in the tradeoff of safety vs. Usability?

947


Is vector a class in c++?

791


Explain the properties and principles of oop.

726


How can you specify a class in C++?

1009


the first character in the variable name must be an a) special symbol b) number c) alphabet

837


What are the steps in the development cycle?

811


Which coding certification is best?

772


Explain how to initialize a const member data.

796


program explaining feautures of c++

2171