-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExample_4_7.java
More file actions
26 lines (26 loc) · 1.13 KB
/
Example_4_7.java
File metadata and controls
26 lines (26 loc) · 1.13 KB
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
package unit_04.Examples.Example_07;
public class Example_4_7 {
public static void main(String[] args) {
staticTest obj1 = new staticTest();
staticTest obj2 = new staticTest();
System.out.println("> objects first print: ");
System.out.println("> object1: " + obj1);
System.out.println("> object1: " + obj2);
System.out.println(">> Increment count using the class");
staticTest.incrementCount();
System.out.println(">> object1: " + obj1);
System.out.println(">> object2: " + obj2);
System.out.println(">>> Increment count using obj1");
obj1.incrementCount();
System.out.println(">>> object1: " + obj1);
System.out.println(">>> object2: " + obj2);
System.out.println(">>>> Increment count using obj2");
obj2.incrementCount();
System.out.println(">>>> object1: " + obj1);
System.out.println(">>>> object2: " + obj2);
System.out.println(">>>>> set x to 10 in object1");
obj1.setX(10);
System.out.println(">>>>> object1: " + obj1);
System.out.println(">>>>> object2: " + obj2);
}
}