Java Find Last Index Of Array Python Methods Vs Functions