好的,我想知道的是,Java有没有一种方法可以做Python可以在下面做的事情......string_sample="helloworld"string_sample[:-1]>>>"helloworld"string_sample[-1]>>>"d"string_sample[3]>>>"l"因为在我看来,Java让您为相同的结果工作(我特别习惯每次都必须使用2个数字并且缺少-1来表示最后一个字符)Stringstring_sample="helloworld";string_sample.substring(0,string_sample.length()-1);>>>"hell