Advertisement
sergAccount

Untitled

Feb 6th, 2021
644
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.99 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package com.mycompany.app8_dz;
  7.  
  8. /**
  9.  *
  10.  * @author Admin
  11.  */
  12. public class Person {
  13.     // имя, фамилия и возраст человека.
  14.     private String name;
  15.     private String lastName;
  16.     private int age;
  17.     // Alt + Insert
  18.     public Person(String name, String lastName, int age) {
  19.         this.name = name;
  20.         this.lastName = lastName;
  21.         this.age = age;
  22.     }
  23.     public String getName() {
  24.         return name;
  25.     }
  26.     public void setName(String name) {
  27.         this.name = name;
  28.     }
  29.     public String getLastName() {
  30.         return lastName;
  31.     }
  32.     public void setLastName(String lastName) {
  33.         this.lastName = lastName;
  34.     }
  35.     public int getAge() {
  36.         return age;
  37.     }
  38.     public void setAge(int age) {
  39.         this.age = age;
  40.     }
  41. }
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement