Advertisement
abstract_abstract

Untitled

May 23rd, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.34 KB | None | 0 0
  1. class StaticObjects {
  2.     static int i;
  3. }
  4.  
  5. public class Eigth {
  6.     public static void main(String[] args) {
  7.         StaticObjects obj1 = new StaticObjects();
  8.         StaticObjects obj2 = new StaticObjects();
  9.        
  10.         System.out.println(obj1.i);
  11.         System.out.println(obj2.i);
  12.        
  13.         obj1.i++;
  14.  
  15.         System.out.println(obj1.i);
  16.         System.out.println(obj2.i);
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement