SHARE
TWEET

Untitled

a guest Nov 19th, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.Damir;
  2.  
  3.  
  4. import java.util.ArrayList;
  5.  
  6. public class User {
  7.     private String username;
  8.     private String city;
  9.     private int year;
  10.     private ArrayList<User> subscriptions;
  11.     public User(String username){
  12.         this.username = username;
  13.         this.subscriptions = new ArrayList<>();
  14.     }
  15.     public void subscribe(User a){
  16.                 subscriptions.add(a);
  17.     }
  18.     public boolean isFriend(User a){
  19.         return (this.subscriptions.contains(a) & a.subscriptions.contains(this));
  20.     }
  21.     public String getUsername(){
  22.         return username;
  23.     }
  24.     public void sendMessage(User u, String text){
  25.         Message.addNewMessage(this, u, text);
  26.     }
  27.  
  28. }
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