feat(exceptions): implement examples of checked and unchecked exception handling

This commit is contained in:
2026-05-10 00:07:12 +03:30
parent f29dc564fb
commit 286b7aaef3
5 changed files with 239 additions and 0 deletions
@@ -0,0 +1,84 @@
package org.exceptions;
import java.util.Date;
public class UserEntity {
private String firstName;
private String lastName;
private Long nationalCode;
private String email;
private Long phoneNumber;
private Date dateOfBirth;
public UserEntity(String firstName, String lastName, Long nationalCode, String email, Long phoneNumber, Date dateOfBirth) {
this.firstName = firstName;
this.lastName = lastName;
this.nationalCode = nationalCode;
this.email = email;
this.phoneNumber = phoneNumber;
this.dateOfBirth = dateOfBirth;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public Long getNationalCode() {
return nationalCode;
}
public void setNationalCode(Long nationalCode) {
this.nationalCode = nationalCode;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Long getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(Long phoneNumber) {
this.phoneNumber = phoneNumber;
}
public Date getDateOfBirth() {
return dateOfBirth;
}
public void setDateOfBirth(Date dateOfBirth) {
this.dateOfBirth = dateOfBirth;
}
@Override
public String toString() {
return "UserEntity{" +
"firstName='" + firstName + '\'' +
", lastName='" + lastName + '\'' +
", nationalCode=" + nationalCode +
", email='" + email + '\'' +
", phoneNumber=" + phoneNumber +
", dateOfBirth=" + dateOfBirth +
'}';
}
}