عاوزه حل هذا السؤال باكواد java ضروري !!!!!!!!!!!!!!!!!

1-Declare a class that describes a person. The class should have the following

instance variables:

  • name: String

  • age: double

  • id: long

  • street: String

  • city: String

The class should have at least two different constructors and the method details

that print the person details.

You should test this class by instantiating it and check the details method.


مجهول
  • حذف بواسطة المستخدم

أضف 4 مسافات قبل كل سطر لكي يظهر الكود هكدا

class Person{
  private String name;
  private double age;
  private long id;
  private String street;
  private String city;
  Person(String name, double age){
    this.name = name;
    this.age = age;
  }
  Person(String name, double age, String city){
    this.name = name;
    this.age = age;
    this.city = city;
  }
  public String details(){
    return "Name: " + this.name + ", Age: " + this.age + ", id: " + this.id;
  }
}
مجهول
  • حذف بواسطة المستخدم

شكراا جدا