Total members 11895 |It is currently Sun Dec 22, 2024 10:15 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





HI...
i need some hints on Vector and Scalar Quantization coding ASAP :)




Author:
Newbie
User avatar Posts: 2
Have thanks: 0 time

Vector class is in java.util package of java. Vector is dynamic array which can grow automatically according to the required need. Vector does not require any fix dimension like String array and int array. Vector contains many useful methods. To add element in Vector, we can use add() method of vector class. To add elements at fix position, we have to use add(index, object) method.

To get value from Vector, Vector provides get() method and Vector size() method. Size() method returns total number of elements in Vector.

Vector is synchronized, ArrayList is not...

Code:
import java.util.Vector;

public class VectorExample {

    public static void main(String[] args) {

        Vector<String> vc=new Vector<String>();

        //    <E> Element type of Vector e.g. String, Integer, Object ...

        // add vector elements
        vc.add("Vector Object 1");
        vc.add("Vector Object 2");
        vc.add("Vector Object 3");
        vc.add("Vector Object 4");
        vc.add("Vector Object 5");

        // add vector element at index
        vc.add(3, "Element at fix position");

        // vc.size() inform number of elements in Vector
        System.out.println("Vector Size :"+vc.size());

        // get elements of Vector
        for(int i=0;i<vc.size();i++)
        {
            System.out.println("Vector Element "+i+" :"+vc.get(i));
        }
    }
}


_________________
Coding my life with Java, PHP, JavaScript, and Python


Author:
Newbie
User avatar Posts: 39
Have thanks: 15 time

For this message the author isuru has received gratitude : DrRakha
Post new topic Reply to topic  [ 2 posts ] 

  Related Posts  to : Java Coding
 data leakage detection coding in java     -  
 search for coding java/jsp for translation text     -  
 HI! NEW 2 Java & coding a MMOMUD -> Journey Quest Dimensions     -  
 servlet coding     -  
 I am new in PHP, want coding or PHP file     -  
 Coding serialization concepts in C++     -  
 Standard Huffman Coding     -  
 source code of huffman coding ?     -  
 Huffman coding for image compression     -  
 Arithmatic Coding Com-Decompression algorithm     -  









Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com