Dlaczego metoda toString() nie wyświetla informacji o obiekcie?

0

Hej, dlaczego metoda toString() nie wyświetla informacji o obiekcie ?

package Lesson3;

import java.util.Scanner;

public class L03P02ClientsSelect {
    private String name, surname, placeOfresidence, address, dateOfbirth;
    int phone;
    long personalID;

    //constructor
    public L03P02ClientsSelect(String name, String surname, String placeOfresidence, String address, int phone, long personalID, String dateOfbirth) {
        this.name = name;
        this.surname = surname;
        this.placeOfresidence = placeOfresidence;
        this.address = address;
        this.phone = phone;
        this.personalID = personalID;
        this.dateOfbirth = dateOfbirth;
    } 

    @Override
    public String toString() {
        return getName() + ", " + getSurname() + " , "+getPlaceOfresidence()+""+getDateOfbirth()+getPersonalID()+getPhone()+getAddress();
    }

    //getters
    public String getName() {
        return name;
    }

    public String getSurname() {
        return surname;
    }

    public String getPlaceOfresidence() {
        return placeOfresidence;
    }

    public String getAddress() {
        return address;
    }

    public int getPhone() {
        return phone;
    }

    public long getPersonalID() {
        return personalID;
    }

    public String getDateOfbirth() {
        return dateOfbirth;
    }
    public static void main(String[] args) {
        //making objects
        L03P01Clients person1 = new L03P01Clients("Jacek", "Kowalski", "34-234 Sanok", "Mickiewicza 14",
                721875845, 11765432163l, "01-01-1972");
        L03P01Clients person2 = new L03P01Clients("Anna", "Kowalska", "36-200 Kraków", "Grunwaldzka 11",
                987483726, 65465432163l, "04-08-1963");

        //show object
        System.out.println(person1.toString());
        System.out.println(person2.toString());
    }
  }

W wyniku dostaję:

Lesson3.L03P01Clients@5315b42e
Lesson3.L03P01Clients@2ef9b8bc
0

u góry masz public class L03P02ClientsSelect a w mainie L03P01Clients person1 które nie wiadomo czym jest.

1 użytkowników online, w tym zalogowanych: 0, gości: 1