Methods counter compatible with C, C++, and Java