35 questions
#include<iostream>using namespace std;class Test{ private: char* str; public: Test(char* name){ str=name; } void hello(void){ cout << str; }};int main(){ Test ptr(lee); ptr.hello(); ...
Ian Media is a student who is studying with a book called 'The first java programming'. I was studying inheritance and constructor, but the book said that in order for an explicit constructor or impli...
Is this the only way to call a parent class constructor in a structure where C inherits B and B inherits A?class A(object): def __init__(self): print Creator Aclass B(A): def __init__(self): super(B...
How do I create a construct in C++ structure?I want to define the constructor, but I don't know the grammar
Generator(){ var1 = getVar1(); var2 = getVar2(); }vsGenerator(){ initVar1(); initVar2(); }iniVar1(){ var1 = ...}iniVar2(){ var2 = ...}You need to know var1 to get var2 What principles do you have, ...
I'm a student of Java.I learned that you use public to declare a constructor.However, when coding alone, there is no error even if the public is omitted (without typing), and the corresponding constru...
Can abstract classes also have constructors? If you can, how do you use it and why?
I was working on the Java program, and my friend told me to use the static factory method instead of the creator.I didn't tell you why, but I don't know what this means.
I understand that if you inherit another layout when creating a custom view, you need to implement the creator belowI wonder why the defStyleAttr and defStyleRes parameters are needed and used in what...
#include <iostream>#include <cstring>using namespace std;namespace COMP_POS { enum { CLERK = 1, SENIOR, ASSIST, MANAGER }; void ShowPositionInfo(int pos) { switch (pos) { case CLERK: c...
« | - 2 - | » |
© 2024 OneMinuteCode. All rights reserved.