print string method that called from java and initialized in c++