Compare Phone Number(User.java)

 import java.util.*;

import java.util.Scanner;
public class User {

        //Fill your code
    private String name;
    private String username;
    private String  password;
    private Long phoneNumber;
    public User() {
        super();
        // TODO Auto-generated constructor stub
    }
    
    public User(String name, String username, String password, Long phoneNumber) {
        super();
        this.name = name;
        this.username = username;
        this.password = password;
        this.phoneNumber = phoneNumber;
    }



   
    
    public String getName() {
        return name;
    }



   public void setName(String name) {
        this.name = name;
    }



   public String getUsername() {
        return username;
    }



   public void setUsername(String username) {
        this.username = username;
    }



   public String getPassword() {
        return password;
    }



   public void setPassword(String password) {
        this.password = password;
    }



   public Long getPhoneNumber() {
        return phoneNumber;
    }



   public void setPhoneNumber(Long phoneNumber) {
        this.phoneNumber = phoneNumber;
    }





   boolean flag = false;
    public boolean comparePhoneNumber(User user)    {
        
        //Fill your code
        
        if(this.phoneNumber.equals(user.phoneNumber))
        {
            flag = true;
        }
        
        
        return flag;



   }
    
}

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.