Vector add Vector, can't get back the value

import java.util.*;
public class TestingMain {
public static void main(String[] args) {
Vector v1 = new Vector();
Vector v2= new Vector();
v2.addElement("HH");
v2.addElement("JJ");
v1.addElement(v1);
for(int i=0; i<v1.size(); i++ ){
for(int j=0; j<v2.size(); j++){
System.out.println(((Vector)v1.elementAt(i)).elementAt(j).toString());
After compilation (using 1.4.2_04 [Eclipse 3.0M9]), I got the following message...
[(this Collection)]java.lang.ArrayIndexOutOfBoundsException: 1 >= 1
     at java.util.Vector.elementAt(Unknown Source)
     at TestingMain.main(TestingMain.java:27)
Exception in thread "main"
What I got wrong about my code?

Sorry, I post wrong about the code, my corrected version
import java.util.*;
public class TestingMain {
public static void main(String[] args) {
Vector v1 = new Vector();
Vector v2= new Vector();
v2.addElement("HH");
v2.addElement("JJ");
v1.addElement(v2);
for(int i=0; i<v1.size(); i++ ){
for(int j=0; j<v2.size(); j++){
System.out.println(((Vector)v1.elementAt(i)).elementAt(j).toString());
After compilation (using 1.4.2_04 [Eclipse 3.0M9]), I got the following message...
[(this Collection)]java.lang.ArrayIndexOutOfBoundsException: 1 >= 1
     at java.util.Vector.elementAt(Unknown Source)
     at TestingMain.main(TestingMain.java:27)
Exception in thread "main"
What I got wrong about my code?

Similar Messages

  • How can I get back the other version of itunes?

    It was much easier to use and way more confortable, How can I get back the other version of itunes? It was much easier to use and way more confortable
    I can't pass playlists from itunes to my i-pod, and the sthetic of the new itunes is not a good one.
    Could I get back an older version? those were easier to use, more simplier

    Apple wisely leaves a copy of iMovie version 9 installed in the Application folder when you download version 10.

  • How can I get back the quality of ios 5.1.1 back to my iphones 4 and my ipad 2?

    How can I get back the quality of ios 5.1.1 back to my two iphones4 and my ipad2?
    Since more than 6 monthes I can't use
    * video for more than 5 minutes,
    * tv-streams for more than 5 minutes,
    * apple store updates in case of more than one update,
    * itunes download in case of more than one download object,
    * remote control
    * air play with appletv3
    without errors.
    On ios 6.x (incl. 6.1.2) all important apple media integration are just useless.

    I'm sorry, but Apple does not provide a downgrade path for iOS. Because downgrading is unsupported by Apple we cannot discuss it on these forums, but you can use Google to find information on how to install an older version of iOS on any iDevice.

  • I downloaded acdsee camera flash (us$0.99) in Hong Kong's app store, but i cannot find it in the app store after i changed to another iphone. it seems that the app is no longer available in HK, how can I get back the app?

    i downloaded acdsee camera flash (us$0.99) in Hong Kong's app store, but i cannot find it in the app store after i changed to another iphone. it seems that the app is no longer available in HK, how can I get back the app?

    First make sure you are searching the name correctly.
    If the app is no longer in the App Store it is no longer available for download. This happens when Apple has found the app violates the agreement with the developer or when the developer no longer wants the app listed in the App Store.
    If the app is truly no longer in the App Store your only option is to copy it from iTunes on the computer you normall sync with.

  • TS1544 Can I get back the wiped key chain Infomation?

    can I get back the set aside wiped original default keychain?Lost all passwords crest etc can no longer run many programmes help??

    Nope.

  • Can i get back the backup file what i deleted on icloud?

    Can i get back the backup file what i deleted on icloud?please, help me. thanks

    You can't. iSync has been discontinued since Mac OS 10.7 Lion. iSync has no connection with iCloud anyway.

  • How can I get back the two arrow icon of isync on my bar? I'm using OS X 10.8.2 . Thanks

    How can I get back the two arrow icon of isync on my bar? I'm using OS X 10.8.2 . Thanks

    You can't. iSync has been discontinued since Mac OS 10.7 Lion. iSync has no connection with iCloud anyway.

  • 10.9.1 used terminal with rm-rf and deleted my user data. Can I get back the deleted data? Help.

    10.9.1 used terminal with rm-rf and deleted my user data. Can I get back the deleted data? Help.  I really just need mail file and desktop files recovered.

    If data were on the SSD drive with TRIM - practically no chance. If HDD - use DIY recovery software such as DiskDrill or DataResue.
    As quickly as possible turn off the drive where deleted data.
    Use an external HDD with installed OSX for data recovery.
    Alex
    Apple Certified Support Professional

  • HT204074 can we get back the apple id if we deleted?

    once we delete icloud apple id then we create new one..can we get back the old icloud apple ID back?

    You can't delete an Apple ID, all you can do is stop using it. You can delete the iCloud account associated with an Apple ID, but this does not delete the ID, just the account. And yes, you should be able to set the iCloud account back up using that ID.

  • How can i get back the adobe creative cloud shared folder after I deleting it?

    How can i get back the adobe creative cloud shared folder after I deleting it?

    I think Adobe pulled the Creative Connect Desktop app until the new CC release next month. I just built a new PC and noticed it wasn't available in the app manager any more. On my other machines it isn't working anyway. In another post Adobe devs said they new it was down because thay were working out some server issues. It looks like they couldn't resolve them.
    I bought into the CC right from the beginning since I never buy my software outright but rather use a credit card. I thought that getting the whole master suite for $30 a month interest free was a great deal. Having all the software has been great, but it was over a year before we even saw a desktop syncing folder and noe it seens as though we are going to have server problems every time they upgrade the cloud leaving us to have to use the cluncky web interface during these sync blackouts.
    I can tell you Adobe better get it together cause ther starting to p*ss off a lot of loyal customers. It feels like were dealing with a cellphone company who only gives deals to the new customers and once you've signed the contract your screwed.
    Here is the link to whats going on
    Announcement: Creative Cloud file sync service offline (Updated)
    Hide Details
    The Creative Cloud Connection preview is currently offline as we upgrade the service. Please see this blog post for additional details :http://blogs.adobe.com/creativecloud/update-on-creative-cloud-connecti on-and-file-sync-preview/
    All files stored in Creative Cloud can still be accessed and downloaded from the Creative Cloud web page at: https://creative.adobe.com/files
    We sincerely apologize for the inconvenience during this transition.
      by Vikrant Rai (May 17, 2013)

  • Can I get back the color control bar?

    After a 5 hour download and install, the most noticeable change is that Apple changed the left-hand side control bar from colored to all gray. 
    Frankly, I've been very disappointed with Apple's design changes lately, and this one is another example, although, I love the new translucent trash can.  I've figured out work-arounds to many of the changes I find most offensive (e.g. my folders are no longer Yosemite-native neon blue.) 
    Is there a way to get back the colors on the left-hand side control bar in iPhoto? 
    I don't mind digging through hidden folders and re-building the icons so that my interface looks good again.  Any suggestions are appreciated.

    If you want to restore the color to the Finder's sidebar give the open source application cDock a try.  You can change the Dock's background scheme (I use transparent) and add color icons to the Finder's sidebar:

  • How can I get back the Web Clip widget in Dashborad?

    Dear all,
    I accidentally deleted the Web Clip widget together with the Web Clip.wdg in Library/Widgets/ folder by AppCleaner some time ago. Now I cannot use this function to clip content in pages. I have the widget icon in Safari and can crop the webpage without problems, but after I did this action, nothing appeared or happened in the Dashboard since the original web clip widget file is gone.
    I would like to know where and how I can get back the Web Clip.wdg file so that I can perform the Web Clip function again?
    I just saw a user who posted a similar topic on Dec 28, 2008 and his/her problem is solved. I have this same problem like his/hers.
    I would appreciate if anyone can help me, thanks!

    Hi,
    Thank you very much for your help.
    I have tried to use Time Machine to get back the Web Clip but still couldn't, and very strange is when I click Time Machine, I can only choose Windows Applications as the back up disk but not Macintosh Applications, so I cannot restore anything from Macintosh applications.
    I think the best is if anyone has this widget on their Mac and can kindly send it to me by e-mail?
    I would appreciate it so much.

  • How can I get back the data I had before my itunes restored my new phone?

    Plot:
    I broke my iphone 5s.
    I bought a new iphone 5s.
    I started using the phone right away, without restoring it.
    I just connected the phone to my computer and I allowed my itunes to restore it, unknowingly clearing all the current data on it.
    SO~
    Question:
    I have all my OLD old data, but how can I get back all the contacts and photos I put on my new phone before I restored it. I mean it has to be somewhere, right?

    Read this: http://support.apple.com/kb/HT3702
    The money will not leave your account, it is just held temporarily for credit authorization. It will be released soon.

  • Can i get back the sample pictures, music, and vide

    is there a way to get back the original samples from the zen vision m? the sample pictures, music, and videos you first get when you first use your zen vision m? because i had to reformat my dri've when the thing broke, and now i lost everything. i got my songs back, but i didn't get the samples back. i really liked them because they were good quality and stuff, and i didnt even look at all of them yet. can someone help?

    i dont think their is :$ even reformattingdoesnt wrk

  • How can I get back the space to type in web addresses when I click on safari.  it seems to have gone away??

    I am trying to find out how to get back the space  up top of window that appears when I click on safari.  I used to be able to type in web addresses and go to places but somehow I lost the space which was just above or just below gray space that show apple,  store,  mac,  ipod etc.  I am  78 & sometimes get confused.  any hep would be greatly appreciated.  I know I had my arrow on somewhere near that space and heard a sound and when I looked back at my puter that space was gone.  ???    any ideas,, Annette l

    When Safari is active, in the menu bar at the top of the screen, there's a menu labeled View. From that menu, select Show Toolbar. It's right at the top.

Maybe you are looking for

  • How to get the Material-Document-Number wie the delivery-Number+Position???

    Hi, we want to connect mseg and likp+lips. But therefore we need the Material-Document-number concerning this delivery and in likp+lips isn't a Material-Document-Number! Could anybody help me to connect likp+lips with mseg!

  • Blocked Cost centre

    Dear All Please help me out from this issue. My issue is due to some reason we are blocked some cost centres for Posting, we created new Cost centres in place of old one. only thing is which are the blocked cost centres were used in some Orders due t

  • SAP Crystal Reports 2011: Error INS00140 The Product keycode is not valid

    I have followed all of the instructions in the previous thread but am still getting the error message.  I am trying to install on a Windows 7 machine.

  • When validate trigger forms 6i

    Please help me to create when validate item trigger. There is one table "job" - id, status status is X or null. i want to do in forms. when someone is entering value for id, it should check first the status for that id in job table status field. if s

  • Checking system level reports

    hi all, how can i check system level statistics reports from solution manager. please help me. rgds vinnu.