Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q4. Consider the following code snippet. [CO5] a. Identify at least 3 code smells from the below code and name them. [3] b. Refractor the
Q4. Consider the following code snippet. [CO5] a. Identify at least 3 code smells from the below code and name them. [3] b. Refractor the source code to remove 4 different Code smells( write the code segment in your copy which has code smell and then show the correct way to refactor it). [4.5] NB: The "System.out.println" statements should not cause any smells \begin{tabular}{|c|c|} \hline & \begin{tabular}{l} public class Teacher \\ \{ \\ public String teacherName; \\ public String teacherID;; \\ public String InternationalPolitics = "n \\ politics"; \\ public void setTeacherDetails (String \\ teacherName, String teacherID) \\ \{ this.teacherName = teacherName; \\ this.teacherName = teacherID; \\ \} \\ \} \end{tabular} \\ \hline \end{tabular}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started