Return Vector from function and print it out.

Hey guys, I am not sure I'm doing this right. I have a class that currently has one function "getVector". This takes a string that is input and turns into a Vector array and returns the array as Vector.
Then in the second class I simply want to print out the Vector. I get no errors, but it doesn't print anything.
If anyone can see what I am doing wrong I'd appreciate the help.
Thanks!
Here is the first class that has the getVector function
import java.util.*;
public class GetArrays {
    public Vector getVector (String s){
        Vector theVector = new Vector();
        StringTokenizer token=new StringTokenizer(s," ");
            while (token.hasMoreTokens()){
                String tk=token.nextToken();// get each token
                theVector.add(tk);
             }// end while
        return theVector;
    }//end getVector
}//end classAnd here is the class with main that tries to print it out.
import java.util.*;
public class ShowArrays {
    public static void main(String[] args) {
        ShowArrays showArrays = new ShowArrays();
        Vector theArray = new Vector();
        GetArrays getArrays = new GetArrays();
        theArray = getArrays.getVector("testing this function");
        ListIterator iterator = theArray.listIterator(theArray.size());
        while(iterator.hasNext()){
            System.out.println(iterator.next()+"\n");
          }// end while
    }//end main
}//end class

Remove the parameter to your call to. Adding this parameter starts the iterator at the element theArray.size(), which is the end of the array.
ListIterator iterator = theArray.listIterator();

Similar Messages

  • To Fetch Data from GTS and print in R/3

    Hi,
      iam in need of help.
    the core is i have a print program in R/3.from R/3 i have to validate some field with SAPGTS.
    so that i have to apply a RFC call from R/3 ( print program ) to GTS and i have to fetch the data from GTS and print in R/3.
    help me out in finding the RFC.
    the print program is for VL02N

    Mohan:
    SAP and GTS are linked through a RFC destination and the RFC user ID is used to make the call. Once this is set up, you can call GTS through a Function Module call. The set up is normally done by BASIS team
    From the program /SAPSLL/SAPLCD_PI_R3 you can drill down to get details of the specific user-exit which you can use to call GTS tables for specific data.
    Let me know if this helps
    Siva

  • HT4356 My iPad does not find the printer. I have tried the HP app and it works, but in any other app the printer is not seen. How do I get this printer visible to the iPad. All my other network computers find and print with out a problem.

    My iPad does not find the printer. I have tried the HP app and it works, but in any other app the printer is not seen. How do I get this printer visible to the iPad. All my other network computers find and print with out a problem.

    hi
    could you tell us what the other app is please

  • How to get return value from java and read by other application?

    i want to read return value from java and the other application read it.
    for example:
    public class test_return {
        test_return(){
        public int check(){
            return 1;
        public static void main(String args[]){
           new test_return().check();
    }from that class i make as jar file. How to read the return value (1) by other application?
    thx..

    If your installer is requiring some process it invokes to return a particular value on failure, then the installer is seriously broken. There are a bazillion commands your installer could invoke, and any of them could fail, which in turn could invalidate the entire install process, and any of them could return any value on failure. The only value that's consistent (in my experience) is that zero means success and non-zero means failure, with specific non-zero values being different in different programs.
    About the only control you have over the JVM's exit code is that if your main method completes without throwing an exception, the JVM will have an exit code of 0, and if main throws an exception (either explicitly or by not catching one thrown from below), it will be non-zero. I'm not even sure if that's guaranteed, but I would guess that's the case.
    EDIT: I'm kind of full of crap here. If you're writing the Java code, you can call System.exit(whatever). But nonetheless, if your installer requires certain exit codes from any app--java or otherwise--you have a problem.
    Edited by: jverd on Oct 29, 2009 1:27 AM

  • I purchased a book from itunes and cannot figure out how to get it on my ipod nano 7.  I cannot find an answer that works.

    I purchased an audio book from itunes and cannot figure out how to get it on my nano 7.  I have tried everything. 

    Have you double checked to make sure these Audiobooks are configured to sync to your iPod from under the iPod's Books configuration tab in iTunes?  This is assuming that the audiobooks are already stored in your iTunes library and appear under the Books category.
    To access this configuration tab, plug in your iPod and select it from under the Devices section in the left hand pane of iTunes to bring yourself to the iPod's Summary tab. Now locate the Books tab across the top in the main iTunes window and select it. Here you can configure what and how audiobooks are synced to the device.
    If you make any changes to this tab, make sure to hit the Apply button on in the lower right hand corner. This will sync the updated changes to your device.
    B-rock

  • How do you get a list of your contacts nick names and their phone numbers on line and print them out?

    How do you get a list of your contacts nick names and their phone numbers on line and print them out?  I've been trying to figure out how to get the list to print out but I can't even find a complete list to view on Verizon's web site.  Does anyone know how to do this?

    Log into your online account. In the, 'I want to', box type, Manage Contacts.
    Place your cursor over any contact, a pop screen will appear with the option to print your contacts

  • Trying to publish to my BC from Muse and it times out.

    I've been tryng to publish a simple page to BC from muse and it times out, the manage BC under file is greyed out. 
    Don't know what else to do???

    Can we reopen this issue please.
    I've been getting the same message. Applied the above instructions but still get same messaging.
    Here are the screenshots  (NOTE - T & C for Trial Software)
    I've also deleted Muse from the computer and reloaded it through my Creative Cloud account.
    Thanks for your help.

  • I scanned an old image using my Epson NX515 printer, used GIMP to make some minor repairs on the image and printed it out.  I noticed there were a number of evenly spaced thin blue lines across the image, approximately six of them.

    I scanned an old image using my Epson NX515 printer, used GIMP to make some minor repairs on the image and printed it out.  I noticed there were a number of evenly spaced thin blue lines across the image, approximately six of them. I opened & printed the image on my PC using PAINT.NET.  No lines appeared. I sent the image to my daughter. She printed it and found no lines. I printed the image using Seahorse on my Mac and the lines still appeared. I used basically the same print settings on Mac and PC.

    maahes wrote:
    did so now, only now I'm getting a slightly different error: could not find udevd no such file or directory. I checked both grub.cfg's and my mkinitcpio.conf and there's no listing for udevd ....which I've never heard of, so I assumed it was a typo?
    For clarification: udev is in the mkinitcpio.
    I'm not sure whether I yet have a good intuition for how you have your machine set up, but I suspect you need to include a cryptdevice flag to the kernel in your grub config. The file isn't found because the kernel doesn't know your root directory needs decrypting first.
    My setup is an LVM over LUKS over LVM sandwich. To boot into my system, the grub.cfg contains the line:
    linux /vmlinuz-linux root=/dev/mapper/cryptvg-root cryptdevice=/dev/mapper/vg-crypt:root rootfstype=ext4 pcie_aspm=force acpi_osi=Linux acpi_backlight=vendor i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1 ro
    Now, most of those flags don't have anything to do with your problem, but note the cryptdevice. It tells the kernel it's dealing with an encrypted filesystem sitting in a logical volume called crypt on a volume group called vg. The bit after the colon tells the kernel to associate this encrypted filesystem with /dev/mapper/root.
    As for how to fix your system, I'm afraid I still feel a bit fuzzy about how your LVM and encrypted layers relate to each other, whether you have LVM over LUKS, or LUKS over LVM, or something else. Was there a particular how-to that you followed?

  • Can you backup phone contacts and print them out?

    Are you able to view contacts and print them out?

    settings - icloud - contacts - on
    then log into icloud.com - contacts

  • I can't prevent Spotlight from returning results from emails and Safari

    Try as I might, I can't prevent Spotlight from returning results from emails and from Safari web browser history.
    I've toggled the two relevant boxes in the Spotlight system preferences, and rebuilt the index, but it still returns results from categories that I have deselected (like emails and webpages).
    The system preferences say "Only selected categories will appear in Spotlight search results". If only it were true!

    I think this could be a reason, your settings regarding indexing of mail messages didn't stick.
    I'm having other problems with security update 2008-005.
    It'd be interesting to know if OnyX is able to fix your problem again. Hopefully its doings survive the next update.

  • I want to make address labels and print them out. Does anybody know of a word processing program for Mac that would do this?

    I want to make address labels and print them out. Does anybody know of a word processing program for Mac to accomplish this?

    Have you looked at the previous discussions listed on the right side of this page under the heading "More Like This"?

  • Print from wireless laptop and print comes out hours later

    My wife has a wirelessly connected laptop and when she prints from it, the printer doesn't print for a few hours.  When I print from the desktop which is connected directly to the router it prints right away.    We have a Netgear router, windows 7 and the Printer is an HP C5180 All In One.
    Any help would be appreciated.

    If you are able to print from your desktop properly, then the printer has been setup correctly. The issue could be with AV or Firewall programs installed on your wife's laptop, or some connectivity issue between her laptop and your router. These are the only 2 possibilities I can think of at this point. Try to disable the firewall and AV and they try printing.
    Make it easier for other people to find solutions, by marking my answer with \'Accept as Solution\' if it solves your problem.
    Click on the BLUE KUDOS button on the left to say "Thanks"
    I am an ex-HP Employee.

  • Error when returning Vector from EJB Session Bean

    I am testing the EJB functionality within JDeveloper(9.0.3). I simply expanded on the tutorial that is in the documentation (departments and employees). I created a method in the stateless session bean that retrieves a Collection of employees for a department, then converts it to a Vector. When I try to return the Vector from the session bean to a sample client, I get an error indicating that the Object is NOT serializable. I know that Vector IS serializable. Why do I get this error? (The error displays on the client message log, NOT the OC4J message log). I tried dumping the Vector to System.out.println - this works fine, so I l know I'm getting data.
    Here is the stack trace and errors that display:
    com.evermind.server.rmi.OrionRemoteException: Error (de-)serializing object: EmployeeLocal_EntityBeanWrapper4
         java.lang.Object com.evermind.server.ejb.EJBUtils.cloneSerialize(java.lang.Object, com.evermind.server.ejb.AbstractEJBHome)
              EJBUtils.java:404
         java.lang.Object com.evermind.server.ejb.EJBUtils.cloneObject(java.lang.Object, com.evermind.server.ejb.AbstractEJBHome)
              EJBUtils.java:377
         java.lang.Object com.evermind.server.ejb.EJBUtils.cloneOneObjectInstance(java.lang.Object, com.evermind.server.ejb.AbstractEJBHome)
              EJBUtils.java:419
         java.lang.Object com.evermind.server.ejb.EJBUtils.cloneArrayList(java.util.ArrayList, com.evermind.server.ejb.AbstractEJBHome)
              EJBUtils.java:599
         java.lang.Object com.evermind.server.ejb.EJBUtils.cloneObject(java.lang.Object, com.evermind.server.ejb.AbstractEJBHome)
              EJBUtils.java:357
         java.util.Collection hrApp_StatelessSessionBeanWrapper2.getEmployeesByDepartment(java.lang.Long)
              hrApp_StatelessSessionBeanWrapper2.java:323
         java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[])
              native code
         void com.evermind.server.rmi.RMICallHandler.run(java.lang.Thread)
              RMICallHandler.java:119
         void com.evermind.server.rmi.RMICallHandler.run()
              RMICallHandler.java:48
         void EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run()
              PooledExecutor.java:803
         void java.lang.Thread.run()
              Thread.java:484
    at connection to localhost/127.0.0.1 as admin
         void com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(java.lang.Throwable)
              RMIConnection.java:1558
         java.lang.Object com.evermind.server.rmi.RMIConnection.invokeMethod(com.evermind.server.rmi.RMIContext, long, long, java.lang.reflect.Method, java.lang.Object[])
              RMIConnection.java:1511
         java.lang.Object com.evermind.server.rmi.RemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
              RemoteInvocationHandler.java:53
         java.lang.Object com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
              RecoverableRemoteInvocationHandler.java:22
         java.lang.Object com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
              StatelessSessionRemoteInvocationHandler.java:50
         java.util.Collection __Proxy1.getEmployeesByDepartment(java.lang.Long)
         javax.swing.table.DefaultTableModel hr.hrAppClientFrame.getTableModel()
              hrAppClientFrame.java:150
         void hr.hrAppClientFrame.jbInit()
              hrAppClientFrame.java:122
         void hr.hrAppClientFrame.<init>()
              hrAppClientFrame.java:58
         void hr.hrAppClientFrame.main(java.lang.String[])
              hrAppClientFrame.java:141
         Nested exception is:
    java.io.NotSerializableException: EmployeeLocal_EntityBeanWrapper4
         void java.io.ObjectOutputStream.outputObject(java.lang.Object)
              ObjectOutputStream.java:1148
         void java.io.ObjectOutputStream.writeObject(java.lang.Object)
              ObjectOutputStream.java:366
         java.lang.Object com.evermind.server.ejb.EJBUtils.cloneSerialize(java.lang.Object, com.evermind.server.ejb.AbstractEJBHome)
              EJBUtils.java:390
         java.lang.Object com.evermind.server.ejb.EJBUtils.cloneObject(java.lang.Object, com.evermind.server.ejb.AbstractEJBHome)
              EJBUtils.java:377
         java.lang.Object com.evermind.server.ejb.EJBUtils.cloneOneObjectInstance(java.lang.Object, com.evermind.server.ejb.AbstractEJBHome)
              EJBUtils.java:419
         java.lang.Object com.evermind.server.ejb.EJBUtils.cloneArrayList(java.util.ArrayList, com.evermind.server.ejb.AbstractEJBHome)
              EJBUtils.java:599
         java.lang.Object com.evermind.server.ejb.EJBUtils.cloneObject(java.lang.Object, com.evermind.server.ejb.AbstractEJBHome)
              EJBUtils.java:357
         java.util.Collection hrApp_StatelessSessionBeanWrapper2.getEmployeesByDepartment(java.lang.Long)
              hrApp_StatelessSessionBeanWrapper2.java:323
         java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[])
              native code
         void com.evermind.server.rmi.RMICallHandler.run(java.lang.Thread)
              RMICallHandler.java:119
         void com.evermind.server.rmi.RMICallHandler.run()
              RMICallHandler.java:48
         void EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run()
              PooledExecutor.java:803
         void java.lang.Thread.run()
              Thread.java:484
    at connection to localhost/127.0.0.1
         void com.evermind.server.rmi.OrionRemoteException.receive(java.net.InetAddress, java.lang.String)
              OrionRemoteException.java:130
         void com.evermind.server.rmi.RMIConnection.handleMethodInvocationResponse()
              RMIConnection.java:1673
         void com.evermind.server.rmi.RMIConnection.run(java.lang.Thread)
              RMIConnection.java:532
         void com.evermind.server.rmi.RMIConnection.run()
              RMIConnection.java:275
         void EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run()
              PooledExecutor.java:797
         void java.lang.Thread.run()
              Thread.java:484
    Any ideas?
    Thanks

    I would suggest opening a case with [email protected] FWIW, I recall seeing
              something like this in WLS 6.0. I believe it is fixed in WLS 6.1
              -- Rob
              Chris Dupuy wrote:
              > Btw, this occurs when I create an stateful session bean that ends up
              > throwing an exception and setRollbackOnly() is called. From that point
              > forward, my logs fill with this message.
              >
              > Chris
              >
              > "Chris Dupuy" <[email protected]> wrote in message
              > news:[email protected]..
              > > anyone know what this means, and what you can do about it?
              > >
              > >
              > > <Error> <ConnectionManager> <atossd03> <cbeyondServer> <ExecuteThread:
              > '14'
              > > for queue: 'd
              > > efault'> <> <> <000000> <Closing:
              > 'weblogic.rjvm.t3.T3JVMConnection@488831'
              > > because of: 'Server received a message over an uniniti
              > > alized connection: 'JVMMessage from: 'null' to:
              > >
              > '5825313123619479267S:10.6.6.40:[8000,8000,8001,8001,8000,8001,-1]:cbeyond:c
              > > beyond
              > > Server' cmd: 'CMD_REQUEST', QOS: '101', responseId: '2', invokableId: '1',
              > > flags: 'JVMIDs Not Sent, TX Context Not Sent', abbrev o
              > > ffset: '204'''>
              > >
              > >
              > >
              

  • How to get the returned value from Functions with Callable statement?

    I was glad to find that stored procedures can be invoke with Java class code by the object of Callable statement like :
    String stmt = "BEGIN departments_pkg.do_select(?,?,?); END;";
    and getting the output variables by
    populateAttribute(DEPARTMENTNAME,st.getString(2),true,false);
    But i would like to get values returned from FUNCTION other than stored procedure, how can i achieve it? Thanks a lot!

    Here is  my code
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_1202.
      MODULE subscreen_find.
      CALL SUBSCREEN SUBSEARCH INCLUDING sy-cprog dynnr.
    PROCESS AFTER INPUT.
      MODULE USER_COMMAND_1202.
      CALL SUBSCREEN SUBSEARCH.
    MODULE subscreen_find.
      case sy-ucomm.
        when 'SELECTED'.             "fcode
          case 'ZSKILL_SEARCH'.     "data element
            when '01'.                       " value range
              dynnr = 0110.
            when '02'.
              dynnr = 0111.
          endcase.
      endcase.
    ENDMODULE.
    kindly tell me what is wrong
    Edited by: Raji Thomas on Feb 8, 2010 10:20 AM

  • Random words disappear from pdf and printed page

    I work for a newspaper and we have had an ongoing problem from week to week of random words dropping off pages. It happens with the same font family each time but usually only occurs on one page a week. These fonts are used throughout the entire paper and has no problems in other places. The problem seems totally random. I usually send groups of pages (about 25)and the printer then extracts the pages.
    They say the words sometimes drop off when the pages are extracted in acrobat.
    I'm using indesign cs6, with the default "high quality print" setting. The font in question is the Knockout family from the Hoefler foundry. It is open type.
    Does anyone have a solution for this? We had an entire headline drop off last week resulting in the printer having to reprint the entire paper... Not so good.
    I have tried reinstalling the font but it has not helped.

    Yes I export directly from InDesign and then send the files via FTP after that. Once they receive the files, they they use the Document/Extract tool within Acrobat to separate the files. Apparently this is when they find that letters on the page have been replaced by X'd out boxes.
    Their fix is to open the orignal set of pages in Photoshop and rasterize the problem page. I would rather they don't do this so that we don't lose quality. Also, when fonts drop from the page, they can be easily overlooked by an unattentive printer.
    Thanks for your help!

Maybe you are looking for