-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLab_5_6.java
49 lines (30 loc) · 892 Bytes
/
Lab_5_6.java
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
import java.util.*;
class Count{
static int countObject = 0;
public Count(){
countObject += 1;
}
public void printCount(){
System.out.println("the number of of objects are : "+countObject);
}
}
public class Lab_5_6 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Count c1 = new Count();
Count c2 = new Count();
Count c3 = new Count();
Count c4 = new Count();
Count c5 = new Count();
Count c6 = new Count();
Count c7 = new Count();
Count c8 = new Count();
Count c9 = new Count();
Count c10 = new Count();
Count c11 = new Count();
Count c12 = new Count();
Count c13 = new Count();
Count c14 = new Count();
c1.printCount();
}
}