How can I use a iteration control to compare with array?

Dear All
I have done a program and I need to test me program...but I seem to have to problem...I don't know how to use a iteration ( a for loop ) to test my program...
My test code is written like this...
public class ClockWatchDemo
public static void main(String[]args)
TimePiece[] tpList = new TimePiece[3];
tpList[0] = new Watch(200, "Vintage", "Men");
tpList[1] = new Clock(400, "Classic", 70);
tpList[2] = new Clock(300, "Futuristic", 45);
for(int i=0; i<3; i++)
if( i == tpList[0] ) // how can I do to compare my temp integer with the array number?
System.out.println(tpList[0].toString() + "\n");
else
return "";
Please advise

Thank you for your help but how can i compare my temp int i to the tpList array?
I wanted to do something like this
if( i == tpList)
System.out.println(tpList[i].toString() + "\n");
but I will get prompt to inform me that
if( i == tpList[i])
incomparable types : int and TimePiece
Please advise.
Thank you

Similar Messages

  • HOW CAN WE USE ALV-CUSTOM CONTROL

    Dear Friends,
    How can we use the custom control ALV.please provide the sample PPT or material to learn the container ALV.
    Thanks &Regards,
    Rajkumar.A

    SAP released document on ALV custom control. Pretty cool stuff..
    http://www.saphelpbykevin.com/saphelpbykevin/modules.php?name=Downloads&d_op=getit&lid=10#dl
    Edited by: Kevin Nguyen-Tu on May 14, 2008 7:44 PM

  • Can I use ARD to control my mac with Back to my Mac service?

    Can I use ARD to control my mac with Back to my Mac service?
    The with Back to my Mac service on you see your mac in the Shared column, hit Share Screen & your good - on ARD I don't see my remote Mac listed anywhere in that program.
    Thanks

    ARD, to the best of my knowledge, does not work via Back To My Mac. Certainly it's not an direct or obvious feature, though I can't say that there might not be a workaround I've not heard of.

  • How can I use my Dell photo 924 printer with my iMac

    How can I use my Dell photo 924 printer with my iMac, I have tons of ink and don't want to buy a new printer right now.

    People who need to SCAN & PRINT without a compatible driver from their manufacturer can use Apple's very basic "PRINT & SCAN" utility in System Preferences:
    Click the Apple menu ( ), and then click System Preferences .
    Click Print & Scan ( ).
    Click Scan , and then click Open Scanner .
    Click Show Details . The details of the scan display, including options to modify scan settings such as output type.Figure 2: Example of the Show Details scanning screen
    Change any settings as necessary, and then click Scan .
    Hope this helps

  • How can I use a vector image to stretch with the backgrounds in Muse master pages?

    How can I use a vector image to stretch with the backgrounds in Muse master pages?

    Maybe there's a bug.  I think it's only showing it when it wants to because look:

  • How can I use my Ipod as an alarm with wake up to an internet radio?

    How can I use my Ipod as an alarm with wake up to an internet radio?

    You need to find an app that does bot since one app can effect another app (an alarm app can tell an internet radio app to start playing).  There is Trance Radio with Alarm and Radio with Alarm Clock

  • How can I use same account in 2 iphone with diff contact list?

    how can I use same account number but other all totally diff such as contact list, application, everything ..... I found that it's bad on IOS5.
    when I used IOS4 .. old verison, I can keep my phone in diff data. Afte upgrade IOS 5, it's bad. Even take photo, it can not focus zoom in and out.

    how can I use same account number but other all totally diff such as contact list, application, everything ..... I found that it's bad on IOS5.
    when I used IOS4 .. old verison, I can keep my phone in diff data. Afte upgrade IOS 5, it's bad. Even take photo, it can not focus zoom in and out.

  • How can I use the built-in Isight camera with an external camera (usb/firewire) at the same time?

    How can I use the built-in Isight camera and an external video camera at the same time?
    I'm wanting to stream over Oovoo/Skype/etc. using 2 cameras.
    Thanks

    Simple question with a not so simple answer.
    (a) If you mean that you want to run multiple apps simultaneously using a different camera with each app, you may encounter computing power limitations.  Digital video is processor intensive.  The only way to know if your Mac can do this it to try it.  If the video does not work together but each app works when it it the only app running, you are likely overloading your Mac's ability to process and/or move all the required data in your data bus.  You can get a better indication of whether this is the case by watching your Activity Monitor utility while running the apps you want to use.
    (b) If you mean that you want to have more than one compatible camera connected to your Mac simultaneously for ease of changing between video sources, some, but not necessarily all, apps you are using to operate your camera(s) allow you to select between your cameras.
    How you select among connected cameras depends on which application you are using. Here is how camera selection works in a few examples:
    (1) For iChat, you can choose which iSight you use in the "Camera:" choices bar in iChat > Preferences... > Audio/Video that appears when more than one compatible camera is connected. Although your camera choices will be different, the choices bar will look something similar to the Preferences settings shown here:
    If you cannot see the "Camera" choices bar, your Mac is recognizing only one (or none) of your cameras. In that case, consider the suggestions fromhttp://support.apple.com/kb/HT2090 for iSight problems or refer to your other camera's documentation for help.
    This particular choices bar solution applies ONLY to iChat. Most other applications also have settings that allow you to choose which camera to use. However, they do not all work the same way.
    (2) For instance, iMovie HD's camera choice is NOT set via Preferences. When you have more than one compatible camera connected, iMovie6 HD uses a drop-down menu choice something like this (depending on which version of iMovie you use):
    Note: Because I had no built-in iSight connected when I made this example, and because my external iSight was not connected, the drop-down menu showed only "Time Lapse." Because your Mac has a built-in iSight, your built-in iSight would show in the drop-down menu even when no other camera is connected. Connecting an additional Mac compatible webcam should allow you to choose either camera.
    Other iMovie versions work slightly differently.
    iMovie 9 (from iLife '11) uses a different camera choice button shown in this article:
      http://docs.info.apple.com/article.html?path=iMovie/9.0/en/mov39f84285.html
    iMovie 8 (from iLife '09) is slightly different as explained in this article:
      http://docs.info.apple.com/article.html?path=iMovie/8.0/en/10172.html
    In general, you can use your Mac's help for the application in use to find out how to select among more than one connected camera.
    (3) Photo Booth in Snow Leopard 10.6.x and later uses the Photo Booth > Camera menu command to select which camera to use.
    Note for readers with older Mac OS X: The previous version of Photo Booth that came with Tiger (10.4.x) is such a simple, basic app that it offers no menu selectable choice. Unless your built-in iSight is already occupied as the camera being used by some open application before you launch Photo Booth, Photo Booth will use ONLY your built-in iSight.
    However, you can use the trick from ¶ 4 of http://docs.info.apple.com/article.html?artnum=302781 to let Photo Booth use an external camera.
    (If you have an external Firewire camera connected, it may be used in preference to any USB webcam. If that is a problem for you, merely disconnect the problem Firewire device.)
    (4) For FaceTime, launch the app and click the Video menu item.
    If your Mac recognizes more than one connected compatible camera, a "Camera" section listing the cameras from which you can choose will appear there. Clicking on the desired camera name will let you select the one you want as shown in this image from my Mac Pro and LED Cinema Display:
    If your Mac recognizes only one compatible camera, the "Camera" section will not appear in the Video menu, but FaceTime will automatically use the connected camera that is recognized by OS X.
    (5) I do not use Skype oir Oovoo.  For those or other apps, see Help for each app for info on how to select your desired camera.
    Message was edited by: EZ Jim

  • How can I use any website on the internet with my apple tv?

    How Can I use internet or the web on my apple tv?

    Welcome to the Apple Community.
    You can't unless you mirror it from your iPhone or iPad.

  • No ISA slot available in PC. How can I use PCI-85 Modbus Plus card with Lookout?

    My application is to communicate with two Modicon PLCs using Modicon's ModBus Plus (PCI based PCI-85) network card inside my PC, and using Lookout as an SCADA software. Since there is no ISA slot available in new PCs, I can not use Modicon's ISA-85 Modbus Plus networc card. But Lookout does not support PCI based PCI-85 card, how can I use PCI-85 card then, with Lookout? Why doesn't Lookout support it? I asked the following question from from the Modicon's representative about it:
    If I purchase Modbus Plus Driver Suite CD (SWMXDS001, 05, or 10 etc),will I be able to use Lookout SCADA software (by the way, it supports standard MB+ prtocol) for my application? If yes, can I use any version of an
    y of the ISA, PCI, or PCMCIA based MB+ card?
    His answer was:
    The Modbus Plus Driver Suite will talk to any version of card, PCMCIA, ISA, and PCI. The question now is will the SCADA package you are
    planning on using be able to talk to the Modbus Plus Driver Suite? You must contact National Instruments and ask them if they support Modbus Plus, and if
    they used the MB+ system developement kit to develop their product. Or if they wrote their own MB+ drivers, do they work with Modicon hardware?

    Hi,
    currently Lookout does not support the PCI-85 card. The only card supported for Modbus Plus is SA-85. Please see for further information:
    Where can I Find Drivers for Communicating to PLCs, RTUs, and Other Industrial Hardware?
    How to configure the SA-85 card for Modbus Plus
    Hope this helps
    Roland

  • I have a i phone 4,4.3.5 bought from uk i used this in uk but now i am in india how can i use this phone in other networka with out jailbreak such ntype of softwares

    i have a iphone 4,4.3.5 bought from uk i used this phone in uk,now i am in india how can i use this in another networks without jailbreak such type of softwares

    Where did the phone come from as most of the UK carriers unlock phones, but the fact that you are now abroad may be a problem.

  • How can I use javascript in a Text Area with HTML editor??

    My question is... how can I use javascript in Text Area with HTML editor??
    I can use javascript functions that change the content of Text Areas but i can´t if i try in text area with html editor....
    I need to limit number of characters in a text area with html editor and i can´t.
    could anybody help me please?

    I have been experiencing similar problems with the HTML Editor and have managed to find an answer that should start to answer some of my questions. The Apex HTML Editor Standard is actually an HTML editor called FCKeditor. The FCKeditor has a Javascript API that can be found at http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/JavaScript_API. Unfortuately this doesn't seem to give the whole answer and I found more at http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:49607.
    I needed to get the text entered within my html editor standard (e.g. P1_MYTEXT) and use it within my javascript function. I did this by using the following script
    <script language="JavaScript" type="text/javascript">
    function showtext(){
    var oEditor = FCKeditorAPI.GetInstance('P1_MYTEXT');
    var editortext = escape(oEditor.GetXHTML(oEditor.FormatOutput));
    alert(editortext);
    </script>
    Hope this helps.
    Matthew

  • [EWS][Java] How can I use the Search Filter only mails with attachments?

    Hey,
    I'm trying to search a folder ( doesn't matter  which ) for ONLY mails with attachments.
    How can I use the search filter for that purpose? 
    Thanks!

    You can drag the attachment collumn from settings and sort on that collumn
    In the main Outlook window, on the View menu, point to
    Current View, and then click Customize Current View.
    Click Fields. In the Available fields list, click the field that you want to add, and then click
    Add.
    Come back and mark replies as answer if they help, and help others with the same problem. If this post is helpful please vote it as Helpful on the left side.

  • HT1918 how can i use a itunes card for payment with netflix?

    how can i use itunes card for payment for netflix?

    Sorry guy, but I think you are out of luck on that one- maybe someday if Apple gets Netflix under an exclusive contract.. But for now Netflix is its own entity, therefore your account with Netflix is not affiliated with your iTunes account and you have to subscribe and pay for Netflix via credit or debit card.

  • How can I use LabView to control Altera Scripting

    Hi
    I have kind of run into a stone wall. I am building a production test executive based on LabView. Part of this process includes loading an FPGA image on to a CFI flash that is in the JTAG chain. I am trying to make so that the production operators don't have to open a second application, select the right FPGA and Flash navigate to the file then load it, then go back to LabView and run the rest of the tests.
    Altera has a command line interface that will let me load .cdf file.  The problem is that nowhere in Altera’s documentation does it show me how to first load the “Parallel Flash Loader IP” into the FPGA. The flash loader acts as a temporary bridge between the JTAG input and the CFI Flash.  I have looked on Altera’s Forums and have had an open ticket with Altera’s support engineers for more than a week.
    I can’t be the first person to want to do this; I am hoping someone here has done it before. I would really rather not try to use the activeX controls to manipulate the windows based program.
    Any suggestions would be greatly appreciated (Note I am not trying to put LV code on the FPGA/Flash just use LV to control the process)  
    Thanks in advance
    Below is the error message and the script I am using. It almost works just missing the flash loader IP
    C:\altera\12.1sp1\qprogrammer\bin>quartus_pgm -c USB-BLASTER -m JTAG  S_FPGA.
    cdf
    Info: *******************************************************************
    Info: Running Quartus II 32-bit Programmer
        Info: Version 12.1 Build 243 01/31/2013 Service Pack 1 SJ Full Version
        Info: Copyright (C) 1991-2012 Altera Corporation. All rights reserved.
        Info: Your use of Altera Corporation's design tools, logic functions
        Info: and other software and tools, and its AMPP partner logic
        Info: functions, and any output files from any of the foregoing
        Info: (including device programming or simulation files), and any
        Info: associated documentation or information are expressly subject
        Info: to the terms and conditions of the Altera Program License
        Info: Subscription Agreement, Altera MegaCore Function License
        Info: Agreement, or other applicable license agreement, including,
        Info: without limitation, that your use is for the sole purpose of
        Info: programming logic devices manufactured by Altera and sold by
        Info: Altera or its authorized distributors.  Please refer to the
        Info: applicable agreement for further details.
        Info: Processing started: Thu Oct 03 18:16:53 2013
    Info: Command: quartus_pgm -c USB-BLASTER -m JTAG S_FPGA.cdf
    Info (213045): Using programming cable "USB-Blaster [USB-0]"
    Info (209060): Started Programmer operation at Thu Oct 03 18:17:19 2013
    Error (209062): Flash Loader IP not loaded on device 1
    Error (209053): Unexpected error in JTAG server -- error code 5
    Error (209012): Operation failed
    Info (209061): Ended Programmer operation at Thu Oct 03 18:17:21 2013
    Error: Quartus II 32-bit Programmer was unsuccessful. 3 errors, 0 warnings
        Error: Peak virtual memory: 376 megabytes
        Error: Processing ended: Thu Oct 03 18:17:21 2013
        Error: Elapsed time: 00:00:28
        Error: Total CPU time (on all processors): 00:00:03
    Solved!
    Go to Solution.

    Hi Eric,
    I got it figured out today, basically you have to load the Parallel Flash Loader first into FPGA ram. It is a special .sof file (pfl_epXXXX.sof) based on your FPGA. Code is actually pretty straight forward, using the Sys Exec VI. Use the windows based programmer to generate the .cdf file that identifies your FPGA, attached Flash and .pof file .
    Syntax was odd going into Sys Exec. Note the extra "C" in in front of the "quartus_prm.exe" I have no idea why that was needed, but I was getting an error until I just happened to put it in there (Blind Luck :-))
    I used a 2 element array going into a four loop
    cmd /cquartus_pgm.exe -c USB-BLASTER -m JTAG -o P;pfl_epXXXX.sof
    cmd /cquartus_pgm.exe -c USB-BLASTER -m JTAG S_FPGA.cdf
    Defining the working director C:\altera\12.1sp1\qprogrammer\bin
    And added match string with "Successfully performed operation" on the output in the loop to make sure everything loaded correctly then adding the array to give me a overall P/F
    To anyone doing this same thing Altera's documentation is poor to say the least. It took most of a week to figure this out Not allowed to upload code, so anyone wanting details just post here and I will try to help. This was painful, with lots of lessons learned.
    Thanks for the interest though
    Best regards John

Maybe you are looking for

  • In Firefox 4, back button only goes back 1 page at a time. how can i go back further with one click?

    in Firefox 3.6.10, i could click an arrow next to the back button for a drop down menu of previously visited pages. in Firefox 4, i can only go back one page at a time. has it been removed in the new version or am i just overlooking it? in case you'v

  • How to print the values of type Object?

    Hi All, I am not able to print values of the following can anyone telme where i am wrong and what i can do in this regard. Object one = request.getAttribute("values"); When i try to print these values as following System.out.println("one ="+one); am

  • Isight with horrible quality in ichat

    Connection between two brand new MBP (13" an 15"). Own picture is in way bettwer quality than the big video stream of the counter part. Quicktime streaming settings were already set to 1,5 MBit. isight cam works great - at least the pics taken with P

  • App Installation Fried iPhone

    During the process of downloading and installing an application from the App Store, the iPhone (non 3-G) crashed and displayed the white Apple logo. Now never stops displaying the logo. I can shut down by pressing the top switch, but get no red slide

  • ATV shows my photomaps in an other sequence than my computer

    ATV shows my photomaps in an other sequence than my computer Changed several photo date and time stamps, does not change THE sequence