How do i tell the arraylist that i want to get customer object at index i

hi,
i am using arraylist to add customers... i am trying to get customer info at at the specified index but i keep getting the error message " found object... required Customer"
There is a way to tell the arraylist that the object is Customer . i know this Cause my teacher told us this last week.. but i forgot... so please can u guys plz tell me how to do it.
thanks
package banking.domain;
import java.util.*;
* The Bank class implements the Singleton design pattern, because
* there should be only one bank object.
public class Bank {
   * The class variable that holds the single Bank instance.
  private static final Bank bankInstance = new Bank();
  public static Bank getBank() {
    return bankInstance;
// private static final int MAX_CUSTOMERS = 10;
  private static final double SAVINGS_RATE = 3.5;
  //private Customer[] customers;
  private Customer c;
  private ArrayList customers = new ArrayList();
int i =0;
  private int        numberOfCustomers;
  private Bank() {
   // customers = new Customer[MAX_CUSTOMERS];
    numberOfCustomers = 0;
  public void addCustomer(String f, String l) {
     i = numberOfCustomers++;
    //customers[i] = new Customer(f, l);
    customers.add(i, new Customer(f,l));
  public Customer getCustomer() {
    //return customers[customer_index];
    return customers.get(i);
  public int getNumOfCustomers() {
    return numberOfCustomers;
}

hi,
i think i fixed it.. well the error has gone so i must have.
is this casting.. i saw sumthing similar to this on an article about casting
Customer c = (Customer)customers.get(d);
anyway thanks

Similar Messages

  • I'm trying to install an update to itunes that downloaded but can't complete installation as its trying to install onto D: drive. I don't have a D drive and i'm not given option of selecting the drive to install on. How can i select the drive that i want

    I'm trying to install itunes but can't complete installation as its trying to install onto F: drive. I don't have a F drive and I'm not given option of selecting the drive to install on. How can I select the drive that i want to install on?

    Hi,
    How do you connect the printer to the XP machine ? If USB, you need to make that machine as a Print server. Please try this:
       http://techtips.salon.com/make-windows-computer-pr​int-server-11914.html
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • HT1386 how do i change the pc that i want to sync to?

    how do i change the pc that i want to sync to?

    https://discussions.apple.com/docs/DOC-3141

  • How can we tell the client that use process order or production order (proc

    Dear guru,
    My question on what reason we can tell the client that u have to use process order or production order .
    On what scenario we suggest client that use process order or production order

    Hi,
    Process manufacturing is primarily designed for the chemical, pharmaceutical, food and beverage industries as well as the batch-oriented electronics industry
    Discrete manufacturing is u201Cthe production of distinct items such as automobiles, appliances, or computers,u201D whereas process manufacturing covers u201Cproduction that adds value by mixing, separating, forming, and/or performing chemical reactions. It may be done in either batch or continuous mode.u201D
    Letu2019s think about what your company manufactures. Does it require mixing chemicals? If so, you may need an ERP system that does things like calculate ingredient quantities.
    If your company assembles products from many component parts, youu2019ll require discrete manufacturing functionality
    Other approach:
    If the finish good cannot return back to its basic components, your manufacturing is Process. For instance, the finish good is a can of soda. It cannot return back to its basic components such as carbonated water, potassium benzoate, aspartame, citric acid, and other ingredients. But if the finish good is car or computer, your manufacturing process is Discrete because it can be disassembled and the parts, to a large extent, can be returned to stock. Therefore Bill of Material (BOM) of discrete manufacturing consists of component parts for assembly while Process manufacturing consist of formulas, recipes and other ingredients
    Process manufacturing is scalable. If a formula calls for 1,000 pounds of cake flour, but you only have 500 pounds, you can still bake cakesu2014just not as many. Conversely, in discrete manufacturing, one missing part means waiting for it before the finished assembly unit can start rolling off the production line
    The obligatory requisite for process manufacturing is Lot Potency and Shelf Life where as discrete manufacturing values Serial Numbers, ECNu2019s and assembles.
    If it is discrete manufacturing ---go for Production order
    If it is process manufacturing ---go for process order
    thanks and regards
    Venkat V

  • How do i change the account that i want to buy my apps from?

    i want to change the account that i buy my apps from but i dont know how! any assistance?

    Log out of your old account on iTunes and then re-sync your iPod Touch. Unplug your iPod Touch and then next time you go to the apps store, it'll ask you for your FULL account details i.e. e-mail address and password. Enter in the new account details and you shoudl be sorted.

  • TS4036 My old iPhone got damage and sprint changed it when I try to restore from iCloud I don't have the option to choose the latest back up instead it restored a version that is like 192 days old. How can I see the restore that I want?

    Hello
    Today I got my iPhone 4s changed from sprint and when I enter my icloud information it gives me an old backup (196 days old) and I back up automatically all nights , there was no choice to select which one I wanted or anything. So I ended up loosing a lot of important information, all the pictures and everything that I did the past 196 days. I try to see if there is a place on the web that the back up data is displayed but I haven't found anything. I have a lot of important information on icloud, to the extend that I even pay for more space because I use the  iPhone as part of my work. Can someone please explain to me what has happen and if there is a way that I can recover my information? I am desperate it is very important. Thank you very much!
    Fransuas

    Once in a while the restore process seems to mess up.  What I don't understand is why you would perform a weekly restore.
    At any rate, if you must restore, perform a device reset (settings>general>reset) and then you will have the opportunity to restore from iCloud.  Restore a device whenever it no longer works correctly, not just as a matter of maintenance.  If it ain't broke, don't fix it.

  • How can i save the shapes that i have drawn to custom shapes?

    hi using Lasso i have created a good shpae that i require in my work. so now i want to save that shape i have drawn to custom shapes so that i can use it later also in my future works. how to achieve this? Thanks in advance.

    Hello, right click inside your selection, select "make work path", then go to edit>define custom shape... It will now be availalbe to be reused immediately.
    To make sure it is permanently saved, go to edit>Presets>presets manager, change the drop down to custom shapes, target the new shape, and clic on Save set...

  • How do you specify the folder that you want to save a download to? I only see the options for recent places or favourites? How do you drill down?

    how do drill down into the folders when downloading? I only get the option of recent places and favourites?

    Using Safari ??
    From your Safari menu bar click Safari > Preferences then select the General tab.
    Click the:  Save downloaded files to pop up menu then click Downloads or click Other then navigate to the folder you want to use to save downloaded files to.

  • I guess i updated to latest version of Firefox and now i have a bunch of crap at the top of the screen that i want to get rid of. can't find any way to do it. i want my old opening window.

    Don't want "newspapers," "real estate," etc. at top of window. Unnecessary stuff. with previous version of Firefox it wasn't there. don't want it. no noticeable way to get rid of it.

    Is that part of the web page or is that positioned on a toolbar?
    *Firefox > Options
    *View > Toolbars
    Do a malware check with some malware scanning programs on the Windows computer.<br />
    You need to scan with all programs because each program detects different malware.<br />
    Make sure that you update each program to get the latest version of their databases before doing a scan.<br /><br />
    *http://www.malwarebytes.org/mbam.php - Malwarebytes' Anti-Malware
    *http://www.superantispyware.com/ - SuperAntispyware
    *http://www.microsoft.com/windows/products/winfamily/defender/default.mspx - Windows Defender: Home Page
    *http://www.safer-networking.org/en/index.html - Spybot Search & Destroy
    *http://www.lavasoft.com/products/ad_aware_free.php - Ad-Aware Free
    See also:
    *"Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked

  • How do i uninstall the Yahoo toolbar. i want to get rid of it completely

    I installed the Yahoo tool bar. i disabled it but I want to completely uninstall it

    See: [http://help.yahoo.com/l/mye/yahoo/toolbar/troubleshootff/toolbar-55.html How to uninstall the Yahoo Toolbar]

  • HT201272 The songs that I want to get are not appearing, please help! What is the problem?

    Someone help VERY FAST!

    Probelm solved -_- But if anyone could explain why it happened that would help

  • How do I know the iphone 5 I want to purchase is factory? unlocked?

    how can I tell the iPhone 5 I want to purchase is factory unlocked?

    If you take out an ad in the paper, you generally have to provide an address, which the paper should be checking for legitimacy and keeping on file.
    If you sell something on ebay, there is at least a dispute mechanism.
    craigslist is completely un-vetted. You can use it if you like. As far as I'm concerned, it's the wild-west of the Internet. Anything goes, no-one is held accountable. Sure, you can meet someone in broad daylight in a public place... no garauntee that the phone isn't jailbroken, or hacked, or stolen. At the moment, stolen only matters if it's a CDMA phone, provided you don't mind being charged with receiving stolen property if it gets traced to you.
    Hopefully, that will change with the new stolen phone registry that's in the works. Still wouldn't do business on craigslist, though. Maybe I'm just old and crotchety, but I can tell you for sure that no-one there will rip me off.

  • I updated my iPod and it erased everything i had on it.  How do i retrieve the songs that i bought from the iTunes store?  when i try to download/buy them again they tell me i have already purchased them do i want to buy them again?

    I updated my iPod and it erased everything i had on it.  How do i retrieve the songs that i bought from the iTunes store?  when i try to download/buy them again they tell me i have already purchased them do i want to buy them again?  I have authorized my computer but none of them are in my music now.

    You buy one and only one download.
    It is your responsibility to move/copy/backup your music.
    Certainly you did not update your ipod without making sure that you had transferred anything purchased on the ipod to your computer and included it in your regular backup copy of your computer.

  • Hi!pls tell me how can I cancel the files that download,but they can not be downloaded,there maybe a. Problem.

    hi!pls tell me how can I cancel the files that download,but they can not be downloaded,there maybe a. Problem.

    What files, and downloaded from where and by what app?

  • How do you tell the difference between a genuine USB to Lightning cable? I spoke to two different operators at Apple Support. One said that it has Designed in California Made in China and the serial number on it, and the other operator said it didn't

    How can you tell the difference between a genuine Apple lead and the cheap, or sometimes not so cheap imitations? I spoke with two people at Apple Support - one said that it has Designed in California Made in China and the serial number stamped on it, and the other said it didn't. Come on guys, how are we supposed to tell if you can't? I'd really like to know how to identify my lead amongst my daughter's gazillion fakes?

    All my cables are genuine either with the devices or from Apple retail Store I have never found a serial number on any regardless of which length ,I have all three lengths
    In fact they have nothing printed at all only a USB logo at relevant end

Maybe you are looking for

  • Definition flash.media:StageWebView could not be found ?(help)

    how to fix Definition flash.media:StageWebView could not be found.using adobe flash cs5 v11

  • Upgrading Envy 17 3D to SSD

    I have an Envy 17 3D, and I wanted to upgrade it to a SSD Boot drive to speed things up and eek out a bit more battery life. I got an OCZ 3 Agility 120 GB SSD, I was able to run through the recovery DVD I created to install Windows 7, but on reboot I

  • Finance on a new Intel Mac mini

    Hi, My mac min has just died and i was wondering if i should get the new Intel 1, after just claiming on insurance for my powerbook it seems abit dodgy to claim again, how old in the UK do you have to be to take out finance, as a 15 year old, i havnt

  • Error occurred in derivation rule

    Dear All, After saving the billing document, & it is not realesed to A/c. Document.My client came across the following error; Error occurred in derivation rule. See long text Message no. K/111 CO-PA Characteristic Derivation Diagnosis Step 0031 Categ

  • How does iWeb handle packaged files. (Like Keynote files)

    I'm going to be changing this site soon, but I wanted to check here before I did. Symbolic Representation At the bottom of the page are two .key files for Keynote. When I dropped them onto iWeb, it shows them added as filename.key.zip but in the Doma