Question: 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](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f00961714c7_07266f00960e3db3.jpg)
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
Get step-by-step solutions from verified subject matter experts
