classes and method should do one thing like the code below:
class A {
public int a() {
b();
}
private int b() {
c();
}
private int c() {
}
}
The code mentioned below I found it as an interface in Clean Code book written by Robert C. Martin. I found some class like this in the book. In the code block the two methods doing two tasks.
class Modem {
boolean connect() {
//doing something
}
boolean disconnect() {
//doing something
}
}
But why by doing more than one thing like the second code block is valid?