Line 5 is illegal because method three() is a non-static method referenced into a static method. In java you can’t directly reference a non-static method inside a static method.
Line 6 and 13 are illegal because method four() is not static and in java you can’t make a static reference to a non-static method.
CDG
Answers: C, D, G
Explanation:
Line 5 is illegal because method three() is a non-static method referenced into a static method. In java you can’t directly reference a non-static method inside a static method.
Line 6 and 13 are illegal because method four() is not static and in java you can’t make a static reference to a non-static method.