Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Pesel;
- import java.util.*;
- public class WprowadzDane{
- public static void main(String[] args) {
- System.out.println("Wprowadz Dane: String Imie, String nazwisko, int pesel");
- Scanner czytnik = new Scanner(System.in);
- Osoba p1 = new Osoba(czytnik.nextLine(), czytnik.nextLine(),czytnik.nextInt());
- System.out.println(p1.toString());
- }
- }
- class Osoba{
- private String imie;
- private String nazwisko;
- private int pesel;
- public Osoba(){
- }
- public Osoba(String imie, String nazwisko, int pesel) {
- this.imie = imie;
- this.nazwisko = nazwisko;
- this.pesel = pesel;
- }
- public String getImie() {
- return imie;
- }
- public void setImie(String imie) {
- this.imie = imie;
- }
- public String getNazwisko() {
- return nazwisko;
- }
- public void setNazwisko(String nazwisko) {
- this.nazwisko = nazwisko;
- }
- public int getPesel() {
- return pesel;
- }
- public void setPesel(int pesel) {
- this.pesel = pesel;
- }
- public String toString(){
- return getImie()+" "+getNazwisko()+" "+getPesel();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement