Try the following:
import static java.lang.Integer.parseInt; public class Test { public static void main(String[] args) { System.out.println(parseInt("12345")); } private static int parseInt(String str) { System.out.println("str"); return 123; } }
result:
str 123
the method in your class is executed first.
source share