Converting Array to ArrayList not working

Dear Members :
Following line fails to convert my array to arraylist:
List myArrayList = Arrays.asList(myArray);
bcoz when I do
System.out.println("ArrayList: "+myArrayList);
it returns [[I@3e25a5]. The array is just a standard array: int[] myArray.
I even tried with: List myArrayList = new ArrayList(Arrays.asList(myArray)); but same.
Could you please suggest a solution to this ?
Thanks in advance.
Atanu

YoungWinston wrote:
Darryl Burke wrote:
YoungWinston wrote:
I agree, although experienced programmers would probably realize it already.Varargs existed in Java before I ever started learning it. Today for the first time, I'm beginning to understand why some programming veterans hate the feature.I think it has more to do with the <T> .... (T... array) {in the method signature. Generic types can only be references.Agreed. But it's the varargs that obscure the fact that an <tt>int[]</tt> may be treated as a single <tt>T</tt> parameter while an <tt>Object[]</tt> is treated as a <tt>T...</tt>. Which probably has something to do with the attitude of some veteran programmers to autoboxing as well.
db

Similar Messages

  • Array to DataGrid not working. Please help before I lose my mind (and my hair) completely.

    Hi,
    I'm new to the whole flex/as/flash builder, but I'm trying to do a seemingly simple thing and it's not working.
    Flex Mobile project has a button and data grid. When I press the button a 2 dimensional array is build with random numbers. Then I want to show the array on datagrid.
    The array does get build but it's not showing up on data grid.
    Any help would be appreciated as I've spent lots of time on this without any solution.
    Thanks,
    <?xml version="1.0" encoding="utf-8"?>
    <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark" title="HomeView">
    <fx:Declarations>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <fx:Script>
      <![CDATA[
       import flash.events.Event;
       import mx.collections.ArrayList;  
       import mx.collections.ArrayCollection;
       import spark.events.ViewNavigatorEvent;
       protected function cmdStart1_clickHandler(event:MouseEvent):void
        DataGridTest1();
       protected function DataGridTest1():void
        var board:Array = [];
        var arrList:ArrayList = new ArrayList();
        var i:int = 1;
        var j:int;
        text.text = "";
        for(i; i<=5; i++)
         board[i] = [];
         j = 1;
         for(j; j<=6; j++)
          board[i][j] = Math.round(Math.random() * 10);
        arrList.source = board;
        grid.dataProvider = arrList; 
      ]]>
    </fx:Script>
    <s:Button id="cmdStart1" x="53" y="100" width="394" height="62" label="DataGridTest1 (ArrayList to Grid)"
         click="cmdStart1_clickHandler(event)"/>
    <s:TextArea id="text" x="53" y="240" width="394" height="162"/>
    </s:View>

    Sorry, the <s:TextArea shouldn't be there, I was using it to debug the array. I removed the  <s:DataGrid> instead of <s:TextArea> by mistake.
    Also, I tried to move arrList out of the function but that didn't work.
    Here's the entire code again:
    <?xml version="1.0" encoding="utf-8"?>
    <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark" title="HomeView">
    <fx:Declarations>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <fx:Script>
      <![CDATA[
       import flash.events.Event;
       import mx.collections.ArrayList;  
       import mx.collections.ArrayCollection;
       import spark.events.ViewNavigatorEvent;
       protected function cmdStart1_clickHandler(event:MouseEvent):void
        DataGridTest1();
       protected function DataGridTest1():void
        var board:Array = [];
        var arrList:ArrayList = new ArrayList();
        var i:int = 1;
        var j:int;
        text.text = "";
        for(i; i<=5; i++)
         board[i] = [];
         j = 1;
         for(j; j<=6; j++)
          board[i][j] = Math.round(Math.random() * 10);
        arrList.source = board;
        grid.dataProvider = arrList; 
      ]]>
    </fx:Script>
    <s:Button id="cmdStart1" x="53" y="100" width="394" height="62" label="DataGridTest1 (ArrayList to Grid)"
         click="cmdStart1_clickHandler(event)"/>
    <s:DataGrid id="grid" x="500" y="100" width="236" height="226" />
    </s:View>

  • I bought Smart Photo Converter which do,s not work but i can't get any refund , i have contacted the company but no reply and that was two weeks ago...so do you talk to someone at the App store?

    I bought Smart Photo Converter which does not work but i can't get any refund , i have contacted the company but no reply and that was two weeks ago...so do you talk to someone at the App store?

    Mac App Store Support -
    http://www.apple.com/support/mac/app-store/

  • Converting to PDF is not working

    I pay a monthly fee to be able to convert documents to PDF, but it has not been working.  The 1st 3 documents I converted several months ago were a breeze, but since then going through the same procedure is completely unsuccessful.  All it does is say "uploading" and never goes any further.  Is there any way to get this fixed, or if not how on earth do I find a way to contact this company to cancel my subscription/license?  I can't keep paying for something that does not work.

    Hi jkreed2,
    We would like to help!
    1) What type of doc are you converting to PDF? How large is the document?
    2) Here is how to manage your subscription:
    *Sign in <, in the top right corner using your Adobe.com credentials
    *Click on your name (same location) and select ‘My products and services’
    *From there you can check on your status, log in/account info, update/cxl, etc.
    Looking forward to hearing back from you!
    Regards, Stacy

  • LSMW For Converting Open Sales Orders (not working for more than 1 item)

    Hi,
    I am using following standard object for Open sales orders .
    Object               0090   Sales documents                   
    Method               0000                                     
    Program Name         RVINVB10                                 
    Program Type         D   Direct Input                         
    Its not working for more than 1 line item.
    For more than 1 line item its giving Error saying that
    '102122                         V1                   845
    Print parameter SAPML2 1 is not defined
    Can anybody help me out in this regard.
    Thanks in advance.
    Nitin.

    hello, friend.
    i will still research the subject.  but the first thing that comes into my mind is t-code VA05.  with this, you have the option to change the Plant en masse.  so a possible workaround is for you to list a number of sales orders using VA05.  you then sort the line items by Plant.  choose all items with the same plant, change the plant via mass change... then change back to the original plant.  hopefully, the new settings should apply.
    do test a few sales orders by doing this for a larger scope.
    regards.

  • Convert PDF to WORD not working

    Just purchased ExportPDF - can't convert PDF file to WORD document. the "CONVERT" button on screen not activated.

    Hi Nolan,
    I check the subscription status under the email Id you provided also for security reason i delete the Email id from your previous post.
    I wasn't able to find any subscription under that email id. Please provide me the other email id if you have choose the other one while subscribing for ExportPDF service
    Please visit below mentioned forum thread to send private message to send your personal Information.
    http://forums.adobe.com/thread/1184148
    Regards,
    Ajlan Huda.

  • Downloading DNG converter and it's not working

    I've downloaded, reinstalled, and tried several different versions of DNG converter to download my 2nd shooters Nikon D7100 RAW .NEF files, but it's not finding any images once I have it installed. I've downloaded version 7.4 for Windows, which contains the D7100 update...and I've tried installing the newer version 8.6 as well. Nothing seems to be working. What am I doing wrong?

    If you are new to the DNG converter, it's possible you are getting caught by the prompt where the converter is asking you to locate your raw files. It's only asking for the folder. Don't open the folder containing your raw images or you will get the message that there are no images to convert.

  • Canon 5d MkII converted to ProRes - Effects not working in FCP sequence?

    I am trying to figure out why I can't get any of my effects to show up in the viewer or the canvas when working with 5D Mark II converted footage.
    I converted all my files to ProRes and now nothing but my transitions are working. No Color Correction, no filters, nothing.
    Has anyone else come across this problem?
    Thanks.

    I have been working with 5D files and have not experienced this problem.
    Please note that the 5D will typically record at 30.00 frames per second, not 29.97 fps required by typical TV standards. Canon supposedly has new firmware that "may" correct for this when recording. You should correct for this when converting to Pro Res by forcing the frame rate to 29.97.
    Check the detailed information on the individual clips (Control-click on the clip and check file info)
    If the frame rate is indeed correct, try trashing your FCP preferences and see if that corrects the problem.

  • Itunes "convert higher bitrate songs" not working properly

    hello,
    i recently used the option "convert higher bitrate songs to 128kbps aac" to save storage space on my iphone. it worked like a charm and i saved several gigabytes.
    HOWEVER, as soon as i sync my iphone again, it starts to reencode approx. 60 tracks again! it takes a while of course and after that, the tracks are converted and on my iphone (i checked it). if i sync again it will reencode again the very same tracks (and delete them before from my iphone). this is really annoying because it costs time and cpu usage.
    i didnt changed those files, i checked the date when they were changed, and they werent changend at all this month!
    does anyone have an idea? i really like this option, but if it means that i have to convert 60tracks everytime i sync my iphone, i will have to disable it...
    regards

    I am seeing this artwork bug too, on my nano. It seems to be tied to the 128 kbps songs, but I can't pinpoint exactly what makes it happens.
    All I know is, now that I'm using the 128 conversion, I have to reset my nano at least once per day to get artwork back. It also seems to be tied to coming out of pause or hold. After I've paused music and come back later, the artwork shows a white box. But not all the time, so I wonder if it's only when I pause a song that has lyrics.

  • For dynamically allocated double arrays, sizeof() does not work

    For a typical double array, if you need to get the size, you would use
    numElems=(sizeof(myArray)/sizeof(myArray[0]));
    However, for dynamically allocated double arrays (see here for example) this no longer works.
    For the example above, sizeof(myArray) returns 4, and sizeof(myArray[0]) returns 8.
    Solved!
    Go to Solution.

    That's because sizeof(myArray) is the size of the pointer to the dynamically allocated array.
    sizeof(myArray[0]) is the size of a double (8 bytes).
    If you know the size you malloc'd then just use this instead of the sizeof(myArray) function.
    Array size (for use in bounds checking for example) is a compile-time thing in C89 (though CVI will hack in run-time bounds checking for you in a debug compile).  So even if you cast a malloc'd buffer pointer to an array type, the compiler's out of the picture at run time when the buffer gets established to a (potentially) run-time determined size, so it can't help you.  More modern languages (e.g. Java, C#) all get around this problem.  C99 allows variable length arrays to be declared but I'm not sure NI implemented this in their C99 upgrades.

  • Hyperlinks from converted excel file are not working after pdf file is moved

    I have created a pdf file from an excel file that has hyperlinks in it. The hyperlinks work fine if the files are all kept in the same exact location as the time they were created. Once the files are moved (i.e. emailed to another user) the hyperlinks no longer work. An error message pops up that the file can not be found. Is there a setting or something that I'm missing in acrobat that allows for the files to be moved, so that the hyperlinks still function properly, after creation

    No settings adjustments.
    The issue is that links, once made, have a specific path (as shown when you view the link's text string).
    When you email the files the person who recieves the email and downloads the attachments would have to have the same layout of files/folders you have.
    Without that links are "broken"
    You email a zip file that, when extracted, would create the folders/files in the required layout to reflect what you have.
    Be well...

  • Links in converted DOC to PDF not working properly

    I need to convert a word doc to PDF and retain the hyperlinks. The links all point to PDF documents in other folders. When I convert the word doc to PDF through word's 'save as' or PDF export, the links get update to web URL-like links that open the PDF document in a web browser. Is there a way to preserve the links so that they still open the PDFs in adobe and not a web browser?

    Hey domallavena,
    Could you please let me know what version of Acrobat are you using.
    In order to open the PDF links in Acrobat only (not web browser), you will need  to change settings of link by choosing "Tools> Content Editing> Add or Edit Link" Now, right-click on that link and choose Properties from the context menu.
    Then, select 'Open a file' option to choose the file that you want to open when clicking on that link.
    Specify open preferences whether you wish to open the file in new window or existing one and save the PDF.
    Try this way and let me know how it goes.
    Regards,
    Anubha

  • Converting String to boolean not working

    Hello there - I am having a bit of trouble - I am trying to write a program to evaluate boolean expressions (fully parenthesized) As StringTokenizer goes through the expression, the boolean values are being pushed (as Boolean objects) and popped (converted to String) correctly, but the expression I am using to evaluate them is evaluating false (see my debug below)
    In my current code, I have op1 and op2 coming off of the stack as Strings but am not sure if Boolean.getBoolean() is the right method to use to convert them to boolean values. The Sun docs weren't very helpful and there wasn't anything that I could find on the Sun forum about converting Strings to boolean (vs. Boolean). This is what my evaluate code looks like:
    if (operation.equals("||")) {
    opB1 = Boolean.getBoolean(op1);
    opB2 = Boolean.getBoolean(op2);
    test = (opB1 || opB2);
    System.out.println("test = (opB1 || opB2) " + (opB1 || opB2)); //debug
    System.out.println("opB1 = " + opB1 + " opB2 = " + opB2); //debug
    In the above example - using the expression "( ( 1 < 2 ) && ( 2 > 1 ) )" my debug reads like this:
    Operator added to stack is (
    Operator added to stack is (
    Operand added to stack is 1
    Operator added to stack is <
    Operand added to stack is 2
    Operation removed from stack is <
    Operand removed from stack is 2
    Operand removed from stack is 1
    Boolean operand added to stack is true
    Operation removed from stack is (
    Operator added to stack is &&
    Operator added to stack is (
    Operand added to stack is 2
    Operator added to stack is >
    Operand added to stack is 1
    Operation removed from stack is >
    Operand removed from stack is 1
    Operand removed from stack is 2
    Boolean operand added to stack is true
    Operation removed from stack is (
    Operation removed from stack is &&
    Operand removed from stack is true //NOTE: values are both true
    Operand removed from stack is true
    test = (opB1 && opB2) false //NOTE: expression is evaluating as false
    opB1 = false opB2 = false //NOTE: converted String went from true to false!!
    Boolean operand added to stack is false
    Operation removed from stack is (
    When I changed the type of opB1 & opB2 to type Boolean, and use:
    if (operation.equals("||")) {
    opB1 = Boolean.valueOf(op1);
    opB2 = Boolean.valueOf(op2);
    test = (opB1 || opB2);
    System.out.println("test = (opB1 || opB2) " + (opB1 || opB2)); //debug
    System.out.println("opB1 = " + opB1 + " opB2 = " + opB2); //debug
    I get an error that || and && can't be used on type Boolean.
    I've spent several hours on this boolean part alone - any suggestions? (BTW - sorry for the long message!)

    You're a genius!! Wow I never would have figured that one out in a million years!! BTW - can you tell me how you got your code to be so nicely formatted in the post?
    Everytime I cut and paste - it looks aweful and all of the indentations are gone...
    Thanks again!!!

  • Convert AIFF to MP3 not working

    I want to convert an aiff file into an mp3 file. Here's what I have done: Changed itunes preferences in advanced to mp3 and imported my aiff file into itunes. The file created in my itunes folder is aifc, not mp3. I also tried to drag my aiff file to my library then use the advanced drop down menu to convert to mp3 but the only conversion option says "convert selection to aiff". I have itunes 7.1.1
    4 x 2.5 GHz PowerPC G5   Mac OS X (10.4.8)  

    timsvideo,
    Hi and welcome. I found this article on the topic:
    http://docs.info.apple.com/article.html?path=iTunesMac/7.1/en/574x.html
    Hope it helps,
    S.
    Why reward points?
    The reward system helps to increase community participation. When a community member gives you (or another member) a reward for providing helpful advice or a solution to their question, your accumulated points will increase your status level within the community.
    Members may reward you with 5 points if they deem that your reply is helpful and 10 points if you post a solution to their issue. Likewise, when you mark a reply as Helpful or Solved in your own created topic, you will be awarding the respondent with the same point values.
    Members can see their status level by Forum, Category, or at the main Community level.

  • AS3 arrays and conditionals not working

    I'm working with CS4 and AS3 using timeline coding. I have three sets of movie clips in three different arrays. The idea is to have topArray and downArray movies make zeroArray movies visible. For instance, if topArray[0] and downArray[0] are clicked, then r0_0 becomes visible. PROBLEM: r0_0 becomes visible when EITHER topArray or downArray is clicked. How to make r0_0 wait until BOTH top and downArray movies are clicked?
    //movie clips holdings results -- all invisible
    var zeroRow:Array =[r0_0, r0_1, r0_2, r0_3, r0_4, r0_5, r0_6, r0_7, r0_8, r0_9, r0_10];
    for (var a:int=0; a<zeroRow.length; a++) {zeroRow[a].visible=false}
    //two sets of movie clips -- which will be multiplied
    var topArray:Array = [hor_0, hor_1, hor_2, hor_3, hor_4, hor_5, hor_6, hor_7, hor_8, hor_9, hor_10];
    var downArray:Array = [vert_0, vert_1, vert_2, vert_3, vert_4, vert_5, vert_6, vert_7, vert_8, vert_9, vert_10];
    for(var p:int = 0; p<topArray.length; p++){
    topArray[p].addEventListener(MouseEvent.CLICK, showResults);
    topArray[p].buttonMode=true;
    for(var q:int = 0; q<downArray.length; q++) {
    downArray[q].addEventListener(MouseEvent.CLICK, showResults); 
    downArray[q].buttonMode=true;
    function showResults(event:MouseEvent): void{
    if (downArray[0]&& topArray[0]) {r0_0.visible=true};
    }// function
    Sincerely,
    German

    kglad:
    Thansk for replying. No, movie clips don't get unclicked when clicked. I didn't think of that!
    I've been working on how to make the following code work, but I can get only the first zeroRow movie made visible=true; Can you please look at it and point me to the right direction?
    please keep in mind that topArray and downArray are movie clips that are clicked to make zeroRow movies visible.
    for (var p:int = 0; p<topArray.length; p++) {
        topArray[p].addEventListener(MouseEvent.CLICK, showResults);
        topArray[p].buttonMode = true;
        topArray[p].clicked = false;
    for (var q:int = 0; q<downArray.length; q++) {
        downArray[q].addEventListener(MouseEvent.CLICK, showResults);
        downArray[q].buttonMode = true;
        downArray[q].clicked = false;
    function showResults(event:MouseEvent):void {
        var clickedItem:MovieClip = MovieClip(event.currentTarget);
        var showedMovie:MovieClip= MovieClip(event.currentTarget);
        clickedItem.clicked = true;
        var clickedIndex:int = 0;
        var showedMovieIndex:int =0;
        if(topArray.indexOf(clickedItem) != -1) {
            clickedIndex = topArray.indexOf(clickedItem);
            if(downArray[clickedIndex].clicked == true) {
        zeroRow[showedMovieIndex].visible=true;
        } else if(downArray.indexOf(clickedItem) != -1) {
            clickedIndex = downArray.indexOf(clickedItem);
            if(topArray[clickedIndex].clicked == true) {
        zeroRow[showedMovieIndex]== true;
    }// function
    Sincerely,
    German

Maybe you are looking for

  • Using RMBP in clamshell mode w/ Remote App music stops

    Hi, I've got my MacBook Pro connected to the internal DAC in my Peachtree Audio nova125 integrated stereo amplifier via USB. This allows me play music in iTunes on my MacBook Pro via my stereo speakers. Excellent, but there's a problem... I keep the

  • Help!  Won't turn on, just happened over night.

    My airport extreme has been working fine.  Last night I used apple software update, only thing different then most nights.  This morning I noticed the internet was down, went to the airport extreme and it won't turn on.  No power, no light, no nothin

  • $$PlaceHolder$$ in  RH7 HTML output

    Help!. We have recently upgraded from RH6 to RH7 (as part of Adobe Tech Comm Suite). Opening a RH6 project with RH7 all seems OK (topics, template, TOC, etc.) until I try closing and/or saving a topic. At this point -even if I've made no changes to t

  • Where do i can get the service order attachment details

    Hi Guys, I am developing a report, which it needs to delete the attachments for the particular service order, in which details i can the service order attachment details. Thanks, Gourisankar.

  • Bizarre problem editing pics on G4

    Hi, Using my G4 Cube, where I have my iPhoto album, I can view thumbnails without any problems (even resize with the slider and still view). When I try and view photos full screen or in edit mode the screen area for photos immediately goes blank. The