21/08/2023
using namespace std;
class Laptop
{
private:
int static count;
int static count_destroy;
int RAM;
int Generation;
public:
Laptop()
{
count++;
RAM = 0;
Generation = 0;
}
Laptop(int RAM, int Generation) :RAM(RAM), Generation(Generation)
{
count++;
}
static int getcount()
{
return count;
}
static int getcount_destroy()
{
return count_destroy;
}
~Laptop()
{
count_destroy++;
}
};
int Laptop::count = 0;
int Laptop::count_destroy = 0;
int main()
{
Laptop No1;//object for default constructor
Laptop No2;
{
Laptop No3(3, 3);//this object will be destroyed
} //three objects have been created
cout