Explain Cohesion

Cohesion: The level to which a component executes a single well-stated task. A strongly cohesive technique, for example, will execute a single task, like adding an item to a data structure, or sorting several data, while a weakly cohesive technique will be accountable for some disparate tasks. Weakly cohesive components must, in common, be split into separate more cohesive components. The java.util package is a feebly cohesive package as it includes numerous unrelated classes and interfaces, while the java.io package is extremely cohesive.

   Related Questions in Programming Languages

©TutorsGlobe All rights reserved 2022-2023.