Rookie Question! (Arrays)

Hello,
I hope this is the right forum: I have a simple Java Problem but i do not get it.
Is like that: I have to swap values within an array e.g i have one array with 3 indices. Indice 0 (the first indice) has value 12. The middle indice has no value, and the second indice has value 9. How to swap 9 to 12 and 12 to 9 without direct swap, in other words, by using the middle indice that has no value or is zero? And how do i write it in an array?
My other questions: How do i Declare an array and values of its indices?
I hope this is the right forum or site at all, in cas enot, i hope you still can help or give me links that could help. I really need this.

Please study this tutorial http://java.sun.com/docs/books/tutorial/java/data/arrays.html

Similar Messages

  • Rookie Question: Swap values? Declare an array and values of its indices?

    Hello,
    I hope this is the right forum: I have a simple Java Problem but i do not get it.
    Is like that: I have to swap values within an array e.g i have one array with 3 indices. Indice 0 (the first indice) has value 12. The middle indice has no value, and the second indice has value 9. How to swap 9 to 12 and 12 to 9 without direct swap, in other words, by using the middle indice that has no value or is zero? And how do i write it in an array?
    My other questions: How do i Declare an array and values of its indices?
    I hope this is the right forum or site at all, in cas enot, i hope you still can help or give me links that could help. I really need this.

    Hi Rookie,
         http://forum.sun.com is the best place to get answers for your queries.
         Answer to you first question:
         array[0]=array[0]+array[2]; // array[0] will have 21, because 9+12.
         array[2]=array[0]-array[2]; // array[2] will have 9, because 21-12.
         array[0]=array0]-array[2];  // array[0] will have 12, because 21-9.   
         Hope your first query is resolved.
         I will answer your next query in my next reply.
    Thanks & Regards,
    Charan.  

  • Veteran user, rookie question

    i've grown up on BES and am looking to upgrade my wife's phone (a moto Q w/verizon using wirelesssync which provides full OTA sync -- e-mail, calendar, contacts, etc. -- w/outlook). i understand that without a BES, BIS only keeps the e-mail in sync (calendar, contacts, etc. has to be done via USB?). here's the rookie question: does BIS allow for full e-mail sync with outlook (i.e. reads, deletes, etc. on either the PC or the BB) -- or are there other limitations?
    i hate to lose full OTA sync, but would be willing to give it up if outlook e-mail sync via BIS works just like the BES. e-mail is an @ameritech.net address (yahoo). phone would be an 8330. thx much for any insights you can share.
    Solved!
    Go to Solution.

    Acutally not quite.
    BIS does not sync or reconcile "most" email. It does partially with Gmail, Yahoo and IMAP mail servers. It does not reconcile any mail on POP servers. And, none of that with Outlook (i,e., if you delete an email in Outlook, it will not be deleted on your BB, except in some IMAP configurations where when Outlook also deletes the message off the mail server it then reconciles that delete on the BB.
    Honestly, if you want full mail reconcile, you should look into a hosted exchange server for her, such as 
    http://www.blackberryforums.com/banners/exchangemymail2.jpg
    Does that help?
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Newbie Labview Question: Array of clusters

    1: i am a student
    2: this is not homework or a graded project
    3: I'm a pretty capable programmer, but that's in text-based languages. ;-)
    I have a sensor feed which contains 4 channels. I need to leave all 4 channels active, but I want to select one of them to graph at any given time. The data from the NI driver for the hardware comes as a 1x4 array of 2-element clusters.
    Normally, I'd just index to the desired element in the 1x4 array, and feed that cluster to the appropriate graphing tool, but I'm missing something. I swiped a display element from the NI driver example VI's, but any time I insert blocks between the data feed and the graph I get "bad connection" errors.
    I've been googling and book-looking for several days now, to no avail, I'd appreciate any help in this question.
    in the image at ( http://dl.dropbox.com/u/4286123/LabviewHelp.jpg  ), what block do i need to insert into the highlighted wire to be able to select and graph only one of the 4 data channels, controlled by an integer source?
    Many thanks.
    Solved!
    Go to Solution.

    Use the Index Array funtion found in the Array palette.  Wire in the index number of the waveform you wish to display.
    - tbob
    Inventor of the WORM Global

  • Axis - NEWBIE question - arrays

    I have a basic question with arrays and Axis.
    Let's say I have the following interface:
    public ComplexObject[] testArrayMethod( ComplexObject[] arrayCO,
    String myString);
    If I use the Axis 1.3 Java2WSDL I get something that contains:
    <element name="testArrayMethod">
    <complexType>
    <sequence>
    <element maxOccurs="unbounded" name="in0"
    type="tns2:ComplexObject"/>
    <element name="in1" type="xsd:string"/>
    </sequence>
    </complexType>
    </element>
    If I then use WSDL2Java to generate the WSDD file and then create a
    client to call the method, I get an exception:
    The OperationDesc for testArrayMethod was not synchronized to a
    method of ..........
    In other words it looks like runtime Axis doesn't understand that the
    first parm is an array. What am I doing wrong? Should it wrap ComplexObject into an "array" in the WSDL?

    Thanks for the feedback newark. I have this scenario below:
    // Class for my 1D array
    public class OneRecord {
        private String[] elementData = new String[4];
        public OneRecord() {   
            elementData[0] = null;
            elementData[1] = null;
            elementData[2] = null;
            elementData[3] = null;
        public OneRecord(String v1, String v2, String v3, String v4) {   
            elementData[0] = v1;
            elementData[1] = v2;
            elementData[2] = v3;
            elementData[3] = v4;
        public void setElement(int index, String Data) {
            elementData[index] = Data;
        public String getElement(int index) {
            return elementData[index];
    } Then in my main app I have:
    Vector _dataTable = new Vector(1, 1);
    OneRecord currRecord = new OneRecord("a", "b", "c", "d");
    _dataTable.addElement(currRecord);
    OneRecord temp = (OneRecord)_dataTable.elementAt(1);
    System.out.println(temp.getElement(0)); Are there more efficient data structures out there to save queried data from a server side app? Like I said, i'm still trying to learn the most efficient techniques of coding...esp for the Blackberry. Any suggestions would be great!

  • Easy question array

    Hello experts,
    i have an easy question. I need to store data in a 1D array so that the first data is written in the place of index 1 the second in index 2 aso.  I've tried it but somehow either i only had the last data in all indexes or only the last data in the last index. I am posting you a vi. I know where i should change it but i need a small idea oder change in the vi.
    Thank u for your help.

    Attachments:
    array_shift.vi ‏7 KB

    Please save your VI in ver 8.2 and then paste it on the forum so that i may help in making it into what you want. Without seeing the VI i am guessing that you have elements or 1-D arrays that you want to append into a single array.
    Its simple whether its the elements that you want to build into 1-d array or arrays that you want to make into a single array. Just use the build array function. Connect the input wires to the element and you'll have your 1-D array, provided you havent unchecked Concatenate Inputs in which case you will have a higher order array instead.
    Anyways kindly paste it in changed format so that i may help.
    Regards
    Asad Tirmizi
    Design Engineer
    Institute of Avionics and Aeronautics
    " Its never too late to be, what u want to be"
    Using LabVIEW 8.2

  • Working of remote site (rookie question)

    I can design websites on my computer's hard drive but working of the site is harder. I did not think my changes were taking affect but when I turned my computer on today the updates did take affect. Is there a setting I should select?  I want to edit on the hard drive and then send it to the server but it was not showing up when I went to the browser. Like I said I am a rookie. Thanks in advanced.

    Thanks everyone. Below are links to my site.
    http://www.thelinkmagazine.info
    http://www.thelinkmagazine.info/images/thelink01.png
    As you can tell I messed things up. My friend and I had it working real good at one point but when I did things at home my folders did not match his 100%.  I think I will try to watch some youtube videos before I do any real damage.

  • [Rookie Question]

    Here are the issues/questions:
    1. I cannot get the VCR controls from the skin I selected in
    the import video wizard to show up?
    2. The video does not resize when I resize the Flash player
    or browser, what gives?
    3. The imported video is cropped some of the text runs off
    the screen/stage, did I miss something in the import wizard? Maybe
    the answer to question #2 will help answer/fix this
    Here is what I have done so far:
    I create a new flash document. Use the File/Import to grab a
    WMV and convert it to FLV. The FLV is placed in my library and an
    instance is placed on the stage for me. During the Import video
    wizard I selected a skin to get the VCR controls for playback. I
    uploaded all the files to the web server (all in the same
    directory), that Flash generated (swf (one for the movie and the
    skin), flv generated file, and the html generated by flash.
    The video plays with sound and everything when uploaded to
    the site.
    [Note: I am using Flash Professional 8.]
    Thanks,
    Ed

    ...this stuff will drive you crazy... the skin? that has to
    be in the same directory as the calling .html file; not in the same
    directory as the .swf as you would think...
    Whatever you do...don't put these files in a seperate folder
    from the html file. Keep skin and all the files mention in that
    tutorial in the same folder as the html file.

  • A Bunch of Rookie Questions from an old DOS guy

    Equipment, brand new iMAC 24" with wireless keyboard & mouse, wired LAN.
    I started in the computer world with punch cards and the Microsoft world with DOS 2.0. I now have my first MAC so forgive the dumb questions. I bought a big reference book, I've been through it and the help screens but no luck so far.
    There doesn't seem to be any uninstall for software. Am I correct in assuming that uninstalling is simply a matter of dragging the software folder to the trash?
    How come the Home and End keys don't seem to work in Mail text on my wireless keyboard?
    Why doesn't Searchlight display a "didn't find anything" message?
    Thanks, Peter
    iMAC   Mac OS X (10.4.9)  

    I'll simply add the following regarding software uninstall:
    Uninstalling Software: The Basics
    Most OS X applications are completely self-contained "packages" that can be uninstalled by simply dragging the application to the Trash. Most applications create preference files which are stored in the /Home/Library/Preferences/ folder. Although they do nothing once you delete the associated application, they do take up some disk space. If you want you can located them in the above location and delete them, too.
    Some applications may install an uninstaller program that can be used to remove the application. In some cases the uninstaller may be part of the application's installer, and is invoked by clicking on a Customize button that will appear during the install process.
    Some applications may install components in the /Home/Library/Applications Support/ folder. You can also check there to see if the application has created a folder. You can also delete the folder that's in the Applications Support folder. Again, they don't do anything but take up disk space once the application is trashed.
    Some applications may install a startupitem or a Log In item. Startupitems are usually installed in the /Library/StartupItems/ folder and less often in the /Home/Library/StartupItems/ folder. Log In Items are set in the Accounts preferences. Open System Preferences, click on the Accounts icon, then click on the LogIn Items tab. Locate the item in the list for the application you want to remove and click on the "-" button to delete it from the list.
    If an application installs any other files the best way to track them down is to do a Finder search using the application name or the developer name as the search term.
    There are also several shareware utilities that can uninstall applications:
    AppZapper
    CleanApp
    Yank
    SuperPop
    Uninstaller
    Spring Cleaning
    Look for them at VersionTracker or MacUpdate.
    For more information visit The XLab FAQs and read the FAQ on removing software.

  • Rookie questions on the MBP

    hey guys. been doing some research and have found some of your postings very useful.
    Im FINALLY FINALLY FINALLY able to hop the fense and get my self a mac and im pretty sure im gonna run with the 15.4 MBP maxed out on the specs.
    I have 2 questions for you guys.
    1. What is Rosetta? I keep seeing this term used and I think I have a general understanding of what you guys are talking about but it seems like its something i should definitly be up.
    2. Where do you guys think i can get the best deal on MBP? Ill be purchasing as early as next week and I really want to get the best deal possible...ive never spent this much money on anything in my life.
    thanx so much guys!
    -Jay

    If you buy from third party resellers you may save a few bucks (as someone pointed out, there is very little profit margin on Macs) but then you will have to deal with their return procedures if there are any problems.
    I would always recommend buying from an Apple-authorized dealer, and one with a good reputation. As with any expensive purchase, these things should be researched carefully.
    Dealmac, for what it's worth, won't list resellers who consistently get serious complaints from their readers. They can't vouch for the resellers whose deals they list, but I'm pretty convinced that they don't list deals from fly-by-night dealers, either. Regardless, always do your research before making a purchase. Check a couple of the web sites that give buyer reviews, take your time considering your purchase, and so on.
    But you can save more than "a few bucks" ordering elsewhere - more like a few hundred bucks.     (This is often the case because of lack of sales tax, which Apple charges for every state in the U.S. that has sales tax, while most resellers only charge sales tax for states in which they have a retail presence. Also, while resellers can't reduce the price on a new Mac much, they often have rebates or free-after-rebate add-ons, sometimes on items you definitely would purchase regardless, such as RAM upgrades.)   As for buying it fully-configured from Apple.... I've never done that, and never would. RAM, in particular, is very easy to install yourself, and that in itself will save at least a couple of hundred dollars over buying RAM directly from Apple.
    But... to each his own.  

  • Easy question - Array indicator and control compatibility

    I would like to multiply the contents of an array indicator by a factor (polimorphism allows the multiplication of an array by a number, right?) but the product requires that the array has to be a control.
    How can I fixed this problem?. Thank you very much for your help,
    javier

    I removed the Indicator from the build array - it wasn't necessary. Also, your final array is now 2D. See attached, I believe its what you're asking.
    Doug
    Attachments:
    testing_arrays[1].vi ‏33 KB

  • Rookie Questions

    I'm working on my first DVD Studio Pro project. I don't find any of the templates are looking like I'm wanting, so I'm making a custom menu.
    I've created a video background in Motion. It has an 8 second intro, then continues till 42:05, then loops back to 8:00. I've got that part in the clear.
    In the Motion project there is text that names the chapters, and I want to place buttons next to this text.
    My questions center around buttons.
    I've been trying for about 3 hours (using help, Google, etc.) to figure out how to get white circular buttons that highlight red (a specific shade of red) when selected. I've tried PSD overlays, custom buttons, Layered Menus, nothing seems to be working. What is the best method to do this?
    Because my menu has an intro how do I prevent the buttons from showing up till the loop point?
    Pardon my ignorance, but I'm stumped. Once I get past this I've got my assets encoded and targeting appears to be a breeze, just stuck right here.
    Thanks for the help!

    Buttons will not appear until the loop point (your circles), but if you used elements in DVD SP to make the menu, it can throw things off. (In other words using any part of DVD SP to put any design element, such as the circles themselves will have them show before the loop point.)
    What you do is:
    1.) Make the video in Motion as you did, including all visual elements (i.e., pictures on the menu and everything else other than the circles you want as highlights)
    2.) Encode that as a m2v and also export as a tiff/pict with proper aspect ratio and open in Photoshop using the same aspect correction. Place the circles using Black (as a start) where you want the highlights.) Hide the screen shot and just export the layer(s) with the circle. You could also just to the circles in Motion, hide the other layers, and export the layers with the circles as the highlight layer for use in DVD SP.
    3.) Bring the m2v into DVD SP and set it as menu background
    4.) Bring the overlay in and set as the overlay and map the colors
    5.) Set the loop point to where you want the circles to show.
    You can get a bit fancier and try to fade in the circles in background, designing the circles with glows or using color mapping, etc., but start with the above to get it working then you can tweak as you like once you have it under your belt.
    [Using Motion to Make Animated Background|http://dvdstepbystep.com/motion.php]
    [Mapping overlay colors|http://dvdstepbystep.com/newmap.php]

  • Rookie Question??  IMovie won't play my movies shot on Sony HD-HDR550

    iMovie was able to read and import files from my Sony HD-HDR550. But for some reason it is not able to import these files anymore into iMovie. I was importing them in iMovie and editing them in FCP. But for some reason it is not importing from the camera anymore.
    I was able to do this without trouble -- I loaned my camera to someone who downloaded his files onto a PC but I don't see how that would affect my ability to see and import movies using iMovie. SO FRUSTRATING as it was working FINE before. Any help?

    Since this is an iMovie question, I beg the question, why not ask this in the iMovie forum? Most of us here don't know thing one about iMovie.
    Shane

  • Open Platform rookie question

    Hi
    I have seen many references to an object called OPsystem, which I belive is not JavaCard standard, but comes on cards based on "Open Platform".
    Where can I find a complete API description for OPsystem, with all its functions such as verifyPin() etc.?
    How do I know which cards are based on Open Platform? Is there perhaps a list somewhere?
    I am mainly focused on SIM development, hence interested to know if there are any GSM SIM cards that are based on Open Platform.
    Many thanks,
    asciz

    Open Platform defines the applet management on a JavaCard.
    Then all the JavaCard are Open Platform cards.
    For the specs:
    http://www.globalplatform.org/specificationview.asp?id=card
    Download them and you will whatever you are asking about Open Platform.
    Thomas
    http://jaccal.sourceforge.net/

  • Very simple question: array lenght...

    Hello!
    If I create
    Object[] c=new Object[6];
    but still no put Objects in c, then how much is c.length? 0 or 6 ?
    Sorry, I dont have jdk in this netcafe, and I have to know it now...
    Thank you
    best regards,
    N.

    0.65 kg.
    It's the same weight even if its in water or on the
    ground :)How do you measure the weight of the basketball underwater?BTW should'nt the size of a basketball be lesser in water? may be now u think u shud'nt have left school :)

Maybe you are looking for

  • IStudio hanging while trying to open a project

    Hi, iStudio throws application( DB adapetr) error at the startup, when OK is clicked on the messages, it hangs showing the status as "Loading deploy view". Actually iStudio got closed during creating an event in B2BApp (DB adapter).When opened for th

  • OSM7 how to write the xq in Order State Policy

    In Order State Policy I set for      state:In Progress Order State      request: Cancel Order      a xq code in the Condition Transiction form, which check a xml field and return true or false base on the content, but it does not works. Now, can I lo

  • Identify Supervisor if current Position has more than one A012-assignment

    Hello experts, I wonder if you could help me with this "challenge" please: Starting point is a non-vacant position that owns more than one A012-assignment. For example: Position-ID: 00000001 01.01.2006     31.12.9999     A012     O     004712 01.01.2

  • New to BSP

    I am newbie to BSP.My requirement goes here under. We have a workflow set up for Travel management and the approvals will be done in Lotus Notes. The proposed solution is as follows. I need to develop a BSP page which will be called by Lotus (on clic

  • What is happening to my songs?

    When my IPOD Mini is plugged into the computer and I look at files through "my computer", all of my songs show on the IPOD. Then after I disconnnect and look in the IPOD itself, there are no songs to be found. What am I doing wrong? My original went