Home > Java > javaTutorial > body text

Detailed introduction to obtaining vectors

巴扎黑
Release: 2017-06-15 13:56:49
Original
1187 people have browsed it

The following example demonstrates using the v.add() method of the Vector class and Collections.max() of the Collection class to obtain the maximum element of the vector: /* author by w3cschool.cc Main.java */import java.util.Collections;import java.util.Vector;public class Main { public static void main(String[] args) { Vector v = new V

1. Java Example - Get the maximum element of the vector

Detailed introduction to obtaining vectors

Introduction: The following example demonstrates using the v.add() method of the Vector class and Collections.max() of the Collection class to obtain the maximum element of the vector:

2. Java Example - Get the index value of a vector element

Detailed introduction to obtaining vectors

##Introduction: The following example demonstrates To use the sort() method of the Collections class to sort the vector and use the binarySearch() method to obtain the index value of the vector element:

[Related Q&A recommendations]:

The above is the detailed content of Detailed introduction to obtaining vectors. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!