Computer Science, asked by salbert88888888, 1 year ago

1.How does inheritance influence the working of constructors and destructors?
2.Find the syntax error(s) (if any) in the following
code and correct them:

class ABC
{

int x= 10;
float y,

public:

ABC() {y=5;}

~() {}
}

void main ()

Answers

Answered by mannatmarya
29

Hello

Constructors and destructors obey the same access rules as member functions. ... Derived classes do not inherit or overload constructors or destructors from their base classes, but they do call the constructor and destructor of base classes. Destructors can be declared with the keyword virtual

Thanks

Plz mark me as brain liest


mannatmarya: Thanks
Answered by payal341
5

What I don't understand which class is it this question


payal341: par apne room me akele
payal341: hmmm
payal341: kya Hua
mannatmarya: Stop talking dides
mannatmarya: dudes
payal341: ok
payal341: sry for disturbing u
mannatmarya: F9
salbert88888888: I posted this question for someone to answer on it .If you didn't knew the answer then GTFO out of herr .It ain't a social media app .
salbert88888888: *here
Similar questions