Java Collections reverse()方法与示例

集合类reverse()方法 (Collections Class reverse() method)

  • reverse() method is available in java.util package.

    reverse()方法在java.util包中可用。

  • reverse() method is used to reverse the order of its elements of the given list(l) or in other words, we can say this method is used to change the order of its elements starting from the right side.

    reverse()方法用于反转给定list( l )元素的顺序,换句话说,可以说此方法用于从右侧开始更改其元素的顺序。

  • reverse() method is a static method, so it is accessible with the class name and if we try to access the method with the class object then we will not get an error.

    reverse()方法是静态方法,因此可以使用类名进行访问,如果尝试使用类对象访问该方法,则不会收到错误。

你可能感兴趣的:(列表,java,python,spring,数据结构)