Hi,
how is it possible that:
as method2() is non-static, method1() cannot use it => method1() needs to be static as well.
So why in method2() that is changed to static I can call non-static method3()? What exactly 'new Solution().method3()' works like?
Could anybody explain it to me in an easy way, please?
public static void method1() {
method2();
}
public static void method2() {
new Solution().method3();
}
public void method3() {
method4();
}
public void method4() {
step++;