The S in the famous (or infamous) SOLID acronym stands for the single responsibility principle (which itself has its own acronym, SRP). It means an entity should have only one single responsibility, and no others.
A good and common example of something that does not follow SRP is a function or procedure (“method,” in Java parlance) that does two different things that should obviously be split off to two separate units.
Suppose for example that you and I are tasked with writing a function that takes in a postal code (e.g., a ZIP code as an int), consults an online API and returns the corresponding GPS data.

#java-package #object-oriented #single-responsibility #java #software-development

Java Packages and the Single Responsibility Principle
3.25 GEEK