Which is incorrect? The keyword static is used in a static function declaration
ID: 3782266 • Letter: W
Question
Which is incorrect? The keyword static is used in a static function declaration in a class but not m the function definition. It is legal to call a constructor as a member function of an object of a class, as in class A {public: A(){} A(int x, int y):xx(x), yy(y) {}//other members private; int xx; int yy.}; int main() {A w. w.A(2, 3);//is this legal? A class may have another class typo object as a member A constructor can be called implicitly. (Implicitly means the compiler did it for you.) Example: A x = A();//explicitly A x(2);//implicitlyExplanation / Answer
The first one is not clear (i mean the question is incomplete)
2) The keyword static is used in a static function declaration in a class but not in the function definition .
this answer is incorrect for the question which is given below
it is used mainly for memory management purpose only we can apply java static keyword
with variables,blocks,methods etc.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.