-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClass.cpp
57 lines (45 loc) · 874 Bytes
/
Class.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include<iostream>
#define sp " "
using namespace std;
class Demo{
int x;
protected:
int y;
public:
static int count;
int z;
Demo(){
x = 9;
y = 10;
count += 1;
}
Demo(int a, int b){
this->x = a;
this->y = b;
z = 10;
}
void getNumbers(){
cout<<x<<sp<<y<<endl;
}
static void output(string s){
cout<<"The String is : "<<s<<endl;
}
const static void displayCount(){
cout<<"Count : "<<count<<endl;
}
};
int Demo::count;
static int classNumber = 10;
/*
int main()
{
Demo obj;
obj.displayCount();
Demo obj2, obj3;
obj.getNumbers();
obj.output("Rahul");
// obj3.output("Bordoloi");
obj3.displayCount();
return 0;
}
*/