Trying to use .split with an array element

I have tried multiple ways to split an array element into its components that are separated with a space with this code:
public static void compareHand(String[] hand){
        for (int i = 0; i < hand.length; i++){
            System.out.println(i);
            System.out.println(hand);
String[] tokens = hand[i].split("\\s");
System.out.println(tokens.length);
for (int j = 0; j < tokens.length; j++){
System.out.println(tokens);
I keep getting strange output like the following:
King of Spades
3
[Ljava.lang.String;@10b62c9
[Ljava.lang.String;@10b62c9
[Ljava.lang.String;@10b62c9
where I am expecting:
King of Spades
3
King
of
Spades
Any ideas where I am going wrong?

public static void compareHand(String[] hand){
         for (int i = 0; i < hand.length; i++){
              System.out.println(i);
              System.out.println(hand);
String[] tokens = hand[i].split("\\s");
System.out.println(tokens.length);
for (int j = 0; j < tokens.length; j++){
System.out.println(tokens); // your error is on this line. Hint ... System.out.println(tokens[...]);

Similar Messages

  • I am trying to use Words with friends on my iphone 5.  How do I get rid of   "Connect to itunes to Use Push Notifications

    I am trying to use Words with friends on my iphone 5.  How do I get rid of   "Connect to itunes to Use Push Notifications

    Reading some older threads from 2012 and 2011 it appears the problem was present even then.  Part of the problem was due to people using multiple or different account id's on the various devices.  In my case, I only have one ID and it is the same on all devices yet the iPhone and iPad are still throwing the same error when I try turning on iTunes Match.  This is very frustrating . . . any help out there?  Thanks.

  • I am trying to use livetype with persian alphabet and it doesn't work. what should I do?

    I am trying to use livetype with persian alphabet and it doesn't work. what should I do?

    There is no more LiveType with Motion 5.  You may want to go to the Final Cut Express forum, as that's the only place it's existed for the last few years.

  • Error when trying to use LogMiner with Oracle 8.1.6.0.0

    Hi everybody,
    I'm trying to use LogMiner with Oracle 8.1.6.0.0. When I execute the following code with SQL*Plus, I have an error.
    BEGIN
    DBMS_LOGMNR.START_LOGMNR
    (options =>
    dbms_logmnr.dict_from_online_catalog);
    END;
    The error displayed by SQL*Plus is:
    PLS-00302: 'DICT_FROM_ONLINE_CATALOG' must be declared.
    Please, how to solve this problem?
    Thanks you in advance for your answers.

    user639304 wrote:
    Hi everybody,
    I'm trying to use LogMiner with Oracle 8.1.6.0.0. When I execute the following code with SQL*Plus, I have an error.
    BEGIN
    DBMS_LOGMNR.START_LOGMNR
    (options =>
    dbms_logmnr.dict_from_online_catalog);
    END;
    The error displayed by SQL*Plus is:
    PLS-00302: 'DICT_FROM_ONLINE_CATALOG' must be declared.
    Please, how to solve this problem?
    Thanks you in advance for your answers.Looking at the 8.1.7 doc set (the oldest available on tahiti) I get no hits when searching for 'dict_from_online_catalog'. Searching the 9.2 doc set turns up a reference. Looks like you are trying to use an option that isn't available in your version of Oracle.

  • I have unlocked iphone 5.i tried to use it with tmobile.it shows full network but fails to activate and shows sim invalid.how to make it work?

    i have unlocked iphone 5.i tried to use it with tmobile.it shows full network but fails to activate and shows sim invalid.how to make it work?

    Who was your original carrier; did you call them to ask them to unlock your phone, and are you aware of what their unlock policy is (THey may only unlock for international sims and not US sims

  • I have a new I Pad air and I am trying to use it with a projector and a whiteboard, unfortunately the two are not connecting. Can anyone give me reasons why this might be happening.

    I have a new I Pad air and I am trying to use it with a projector and a whiteboard, unfortunately the two are not connecting. Can anyone give me reasons why this might be happening.

    You can connect via a cable or wireless using an Apple TV.
    http://ipad.about.com/od/iPad_Guide/a/How-To-Connect-Your-Ipad-To-Your-Tv.htm
    Connect an iPad to a Television or Projector
    http://www.everymac.com/systems/apple/ipad/ipad-faq/how-to-connect-ipad-to-tv-te levision-projector.html
    Connecting iPad iPhone or iPod to TV or Projector
    http://www.disabled-world.com/assistivedevices/computer/ipad-tv.php
    iPad Accessories: Connections for a TV or Projector
    http://www.dummies.com/how-to/content/ipad-accessories-connections-for-a-tv-or-p rojector.html
    You may be interested in AirPlay on the Apple TV:
    http://www.apple.com/airplay/
    http://www.apple.com/airplay/
    Alternately, there are Apple Digital AV Adapters for hardwired connections:
    http://support.apple.com/kb/ht4108
    http://support.apple.com/kb/ht4108
     Cheers, Tom

  • I have an apple hdmi adapter i am trying to use it with iphone4 it keeps saying cannot play video not supported??t

    help i have an apple hdmi adapter trying to use it with my iphone4  when i plug it in and go to netflix it plays for a second then says cannot play video not supported???? please help im so frustrated!!!

    Success!! There truly is a light at the end of the tunnel. Apple support really did come through and I am successfully back into my account. Ready to purchase more music. I followed the instructions, with patience I thought I lost, submitted my problem, someone emailed me back within two days and all is now perfect. Thanks again Apple.
    To all the frustrated users out there, don't lose hope!!!

  • Error 4002 when trying to use iMatch with mac

    I have been trying to use iMatch with my mac and I continue to receive error 4002

    user639304 wrote:
    Hi everybody,
    I'm trying to use LogMiner with Oracle 8.1.6.0.0. When I execute the following code with SQL*Plus, I have an error.
    BEGIN
    DBMS_LOGMNR.START_LOGMNR
    (options =>
    dbms_logmnr.dict_from_online_catalog);
    END;
    The error displayed by SQL*Plus is:
    PLS-00302: 'DICT_FROM_ONLINE_CATALOG' must be declared.
    Please, how to solve this problem?
    Thanks you in advance for your answers.Looking at the 8.1.7 doc set (the oldest available on tahiti) I get no hits when searching for 'dict_from_online_catalog'. Searching the 9.2 doc set turns up a reference. Looks like you are trying to use an option that isn't available in your version of Oracle.

  • I don't receive verification email when trying to use Adobe email services in elements 6

    I don't receive verification email when trying to use adobe email services in elements 6.

    Hello zayarlin,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at:
    Rescue email address and how to reset Apple ID security questions
    http://support.apple.com/kb/HT5312
    Best of luck,
    Mario

  • HT1338 I am trying to use FaceTime with my partner in Mexico but is not connecting. We do get the call, but it just does not connect. What should I do?

    I am trying to use FaceTime with my partner in Mexico but is not connecting. We do get the call, but it just does not connect. What should I do?

    Try turning off the Firewall in System Preferences > Security & Privacy
    Apple - Support - FaceTime

  • Doesn't NVL work with Assosiative array elements

    Doesn't NVL work with Assosiative arrays? When i tried to UPDATE empdtls table with the values stored
    in v_ename array, i got no_data_found error because
    the query, select ename bulk collect into v_ename.....returns only 5 rows and v_ename(6) was null. So i tried NVL and COALESCE for v_ename(6). I couldn't succeed.
    Any workarounds?
    create table empdtls
    (ename1 varchar2(30),
    ename2 varchar2(30),
    ename3 varchar2(30),
    ename4 varchar2(30),
    ename5 varchar2(30),
    ename6 varchar2(30),
    location varchar2(30));
    SQL> insert into empdtls(location) values ('NY');
    1 row created.
    SQL> commit;
    declare
    type ename_arraytyp is table of varchar2(100) index by binary_integer;
    v_ename ename_arraytyp;
    begin
    select ename bulk collect into v_ename from emp where sal>2900;
    dbms_output.put_line(v_ename(1));
    dbms_output.put_line(v_ename(2));
    dbms_output.put_line(v_ename(3));
    update empdtls
               set ename1=v_ename(1),
                   ename2=v_ename(2),
                   ename3=v_ename(3),
                   ename4=v_ename(4),
                   ename5=v_ename(5),
                   ename6=NVL(v_ename(6),'No Name')
               where location='NY';
    commit;
    end;
    declare
    ERROR at line 1:
    ORA-01403: no data found
    ORA-06512: at line 9Message was edited by:
    J.Kiechle

    If you used a schema level collection type (i.e. created with CREATE TYPE) you could also use the unsupported SYS_OP_CEG function which appears to return collection elements for given index values without error if the element does not exist.
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    SQL> CREATE OR REPLACE TYPE varchar2_table
      2  AS
      3     TABLE OF VARCHAR2 (4000);
      4  /
    Type created.
    SQL> DECLARE
      2     v_ename varchar2_table;
      3  BEGIN
      4     SELECT ename
      5     BULK COLLECT INTO v_ename
      6     FROM   emp
      7     WHERE  sal > 2900;
      8
      9     UPDATE empdtls
    10        SET ename1 = sys_op_ceg (v_ename, 1),
    11            ename2 = sys_op_ceg (v_ename, 2),
    12            ename3 = sys_op_ceg (v_ename, 3),
    13            ename4 = sys_op_ceg (v_ename, 4),
    14            ename5 = sys_op_ceg (v_ename, 5),
    15            ename6 = sys_op_ceg (v_ename, 6)
    16      WHERE location = 'NY';
    17  END;
    18  /
    PL/SQL procedure successfully completed.
    SQL>

  • Reference to Array of Clusters with an array element

    Hi,
    I have an array of clusters CONTROL (calling it as "top level cluster array") with one of the cluster elements being a cluster array (please see attached).
    I plan to pass "Reference" of this top level cluster to different VIs (like add element VI, insert element VI, delete element VI etc) and access (add/modify delete) the elements in this array.
    In my code, how do I typecast the Array Element (cluster) to the inner cluster (as shown in the figure) ?
    I am using LV RT on PXI.
    Solved!
    Go to Solution.

    You cannot use references in the same way that you use pointers around in C. LabVIEW does not manage memory in the same way that C does. This is actually a good thing, though C programmers find it "cumbersome" or "restrictive". I have also programmed in C, and frankly I prefer LabVIEW's memory management any day of the week.
    You had not initially mentioned that this was going to be done in multiple places at (potentially) the same time. Given that, my recommendation is to look into using Action Engines. They provide a means of basically providing a one-location acccess for your data. By using a single VI to access/modify your data you preclude the generation of race conditions. You may also want to join this with the concept of using variants to provide a means to quickly find your data rather than looping to find the element you're interested in. This technique has been around for a while and it has been discussed before. There are examples floating around. Will need to check to find one. 
    As for your question regarding using the reference method which you tried to employ in your initial approach, that's simply not going to gain you anything. You will still be creating buffers when you try to access the cluster elements. But you already have this information in the array inside the outer for loop, so you're just creating unnecessary extra programming for yourself. 

  • Trying to use Flexbook with Flash Player 10

    I'm trying to use the Flexbook from Ely Greenfield, www.quietlyscheming.com/blog/components/flexbook/, with Flex 3 and Flashplayer 10.
    I'm having problems with multiple lines in Flexbook.as but they all have to do with creating a new Vector, like the example below:
    var delta:Vector;
    delta =new Vector(new Point(x,_pointOfOriginalGrab.y),new Point(x+10,_pointOfOriginalGrab.y+1)); 
    If I use the compiler option 'Enable Strict Type Checking' I get the error:
    1137: Incorrect number of arguments.  Expected no more than 0. FlexBook.as PageFlip2/[source path] src/qs/controls line 1215 Flex Problem
    If I don't use the 'Enable Strict Type Checking' option when the application runs I get this error:
    Error #1007: Instantiation attempted on a non-constructor.
    Can anyone tell me what these errors are trying to tell me?
    Thanks,
    Bob

    I guess that was the issue.  I renamed Ely's Vector class and now it work fine.
    Thanks.

  • Trying to use Variables with the Unknown Computer collection to prompt Task Sequence for Domain, Join Account, Join Password, and Join Location.

    I want to use SCCM 2012 R2 and OSD, to boot a bare metal machine, install and OS, and bind it to Active Directory. The catch is that I want the deployment process in SCCM to prompt for the following pieces of information, and then use that information to
    bind the computer to Active Directory (W/O using MDT) instead of supply the data in the task sequence.
    Computer Name
    Domain
    Domain OU
    Domain Join Account
    I am approaching this in a similar fashion as stated in this blog.
    http://osdblog.com/2013/06/26/add-a-prompt-for-a-computer-name-in-your-sccm-deployment/
    I have added the following collection variables to the unknown computers collection:
    When I launch the task sequence, I am prompted as I would expect. I input the desired information, the deployment competes, but it does not bind to the domain.  Here is what my TS looks like. I intentally disabbled  the apply Network Settings step
    because it forces you to enter specific information if it enabled. I don't want to that, thus why I am trying to use the variables.
    My SMSTS log does not have a whole lot of meaningfull data, but I can post it if someone wants to see it. The only possible thing I could think of would be drivers, their are some driver errors in the log. However, if I turn on the Apply Networking setting
    process in the task sequence and turn off the variables, the machines bind fine. With that in mind, I would not think my problem would be driver related. Anyone out there have expertise in using a process like this, that could assist?
    --Tony

    Awesome! Thanks. One more thing, how should I supply the OSDJoinPassword variable? Should I just enter %OSDJoinPassword%
    for Password and Confirm Password? I can not tell if it will actually read it as a variable or try to use "%OSDJoinPassword%" for
    the actual password.
    --Tony

  • I am having problems with an older ipod running 1.1.2 firmware trying to use earbuds with volume controls made for ipod. any suggestions?

    I am problems with an older Ipod classic running 1.1.2pc using earbuds with Ipod inline remote. The earbuds work fine with my new Ipod but not the older one. Any suggestions?

    1) This is because of software version 1.1. See this
    thread for some options as to how to go back to 1.0,
    which will correct the problem...
    http://discussions.apple.com/thread.jspa?threadID=3754
    59&tstart=0
    2) This tends to happen after videos. Give the iPod a
    minute or two to readjust. It should now be more
    accurate.
    3) This?
    iPod shows a folder icon with exclamation
    point
    4) Restore the iPod
    5) Try these...
    iPod Only Shows An Apple Logo and Will Not Start
    Up
    iPod Only Shows An Apple Logo
    I think 3,4, and 5 are related. Try the options I
    posted for each one.
    btabz
    I just noticed that one of the restore methods you posted was to put it into Disk Mode First rather than just use the resstore straight off, I Have tried that and seems to have solved the problem, If it has thank you. previously I have only tried just restoring it skipping this extra step. Hope my iPod stays healthy, if it doesnt its a warrenty job me thinks any way thanks again

Maybe you are looking for

  • File Order In 7

    Help please go to open and the files are listed in size order and not name order as they were. Any idea on how to change it back? This happened after a printer was installed.....

  • Itunes wifi not up to date

    Its wed. night at 9:45 and itunes on my iphone is still not showing the correct new releases. Anyone else? Am I doing something wrong? iTunes on my mac is up to date.

  • Adobe CS4 Premium installation trouble

    Hi, I got the Adobe CS4 Premium on the original DVDs and copied them over to the HardDisk. I moved and can not find the original DVDs so I am trying to install the Adobe CS4 Premium to my new Macbook but got a problem I hope someone can help me with.

  • CS6 - "error compiling movie - Disk Full"

    This is the message I am getting from both Premiere and Media Encoder cs6 when I try to export my Premiere project.  It is 1080p 59.94fps.  This disk I am exporting to is FAR from full.  I am running Mac OS X 10.7.4 - not sure how else I can export w

  • Probability in Sales Document Type

    Dear SAP Champ I just want to know how can I put Probability, i.e. AWAHR field to 100% because it is coming grey, in my sales document type VOV8. Thanking you!