Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Analyse the following piece of code snippet and find out whether its ok to implement or it needs any improvement. If you feel it needs

Analyse the following piece of code snippet and find out whether its ok to implement or it needs any improvement. If you feel it needs any Improvement or change then suggest the possible changes and give valid reasons for the change
class Employee {
private String name;
private String email;
private String phone;
public Employee (String name, String email, String phone){
this.name = name;
this.email = email;
this.phone = phone;
}
public String getName(){
return name;
}
public void setName (String name){
this.name = name;
}
public String getEmail(){
return email;
}
public void setEmail(String email){
this.email = email;
}
public String getPhone(){
return phone;
}
public void setPhone (String phone){
this.phone = phone;
}
public void saveToDatabase(){
//code to save to database
}
public void sendEmail(){
//Code to send email to employee
}
public void sendSMS (){
// Code to send SMS to employee
}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions

Question

=+What do you want them to think?

Answered: 1 week ago

Question

=+Why should they buy this product/service?

Answered: 1 week ago