If I have the following code, let's say the Parent class has the complexity of O(n^2) according to methods included in the Parent. So if I want to calculate the complexity of inherited class (Child class), does it take the Parent class complexity and its own complexity? something like that complexity of child class = O(O(Parent)+O(Child)) ?
public class Parent {
private int number;
// more stuff
}
public class Child extends Parent {
public void setNumber(int newNum){
this.number = newNum;
}
}