Advertisement
Dackwoon

Ejercicio 1 Persona

May 15th, 2022
540
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1. public class Persona{
  2.     private String name,surname;
  3.     private int ci;
  4.     private long tel;
  5.         public int getCi(){
  6.             return ci;
  7.          }
  8.        public void setCi(int ci) {
  9.            if(ci>100000) {
  10.            this.ci=ci;
  11.            }
  12.        }
  13.        public String getName() {
  14.            return name;
  15.        }
  16.        public void setName(String name) {
  17.            this.name=name;
  18.        }
  19.        public String getSurname() {
  20.         return surname;
  21.        }
  22.        public void setSurname(String surname) {
  23.         this.surname = surname;
  24.        }
  25.        public long getTel() {
  26.         return tel;
  27.        }
  28.        public void setTel(long tel) {
  29.          long maxTel=999999999,minTel=10000000;
  30.             if(tel <= maxTel && tel >= minTel )
  31.         this.tel = tel;
  32.             }
  33.        }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement