public class Person {
private String narne;
private String id;
public Person(String aNarne, name = aName; id = anld;
public String getName () {
return name;
public String getld() { return id;
String anld) {
It has the same name as the class name and does not have any result type.
It initializes the object and its attributes corresponding to the class fields.