daily pastebin goal
16%
SHARE
TWEET

Untitled

a guest Jul 12th, 2018 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Echo2 {
  2.     int count = 0;
  3.     void hello(){
  4.         System.out.println("helloooo...");
  5.     }
  6. }
  7.  
  8. public class Echo1 {
  9.     public static void main (String[] args) {
  10.         Echo2 e1 = new Echo2();
  11.         Echo2 e2 = new Echo2();
  12.        
  13.         int x = 0;
  14.         while (x<4) {
  15.             e1.hello();
  16.             if (x>0) {
  17.                 e2.count=e2.count+e1.count;
  18.             }
  19.             e1.count = e1.count + 1;
  20.             if (x == 3) {
  21.                 e2.count = e2.count + 1;
  22.             }
  23.             x=x+1;
  24.         }
  25.         System.out.println(e2.count);
  26.     }
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top