How can I use instance methods created with HashMap

class Template
static HashMap customer;
a few methods created various customer
public static display() //to display a particular customer information among i've created above
             String objectName,currentObjectName;
          Customer customer;
          Scanner scan=new Scanner(System.in);
          System.out.print("Please enter the customer name");
          objectName=scan.nextLine();
          Iterator iteratorForCustomer=CustomerMap.entrySet().iterator();
          Map.Entry customerEntry=(Map.Entry)iteratorForCustomer.next();
         while(iteratorForCustomer.hasNext())
                customerEntry=(Map.Entry)iteratorForCustomer.next();
                if(objectName.equals((String)customerEntry.getValue()))
          System.out.println("Name : " +customer.getName()); //I'm trying to reference to an instance method getName() here but i can't do that .
}The problem is I've created as many as I want and later in the program I tried to redisplay a particular customer information based on the input (objectName). User type in the objectName and I tried to look for a particular customer Object in the HashMap and display only the relevant customer information. Is there any way to do it ? Thanks everyone in advance.

Peter__Lawrey wrote:
use the get method
[http://www.google.co.uk/search?q=map+tutorial+java]
[http://java.sun.com/docs/books/tutorial/collections/interfaces/map.html]
And then either look at a generics tutorial, or, if you're stuck on a pre-1.5 version of Java, find out about casting

Similar Messages

  • I am new to IPAD and I want o use facetime, how can I use it to communicate with my mac at home, do I need to create another account with a different email account

    I am new to IPAD and I want o use facetime, how can I use it to communicate with my mac at home, do I need to create another account with a different email account

    do I need to create another account with a different email account
    Yes, the email addresses need to be unique to each device. You may use the same Apple ID on each device, but the email address used by each device needs to be different.

  • I was trying to get the iOS 8.2 on my iPhone 5 but then it stopped and my phone is now on recovery mode I have pictures I need and they did not all fit on iCloud  how can I use the phone again with ALL my pictures and videos without restoring it?

    I was trying to get the iOS 8.2 on my iPhone 5 but then it stopped and my phone is now on recovery mode I have pictures I need and they did not all fit on iCloud  how can I use the phone again with ALL my pictures and videos without restoring it?

    Contacts are designed to be synced to a supported application on the computer or a cloud service.
    Pictures taken with the device are designed to regularly be copied off the device to a computer as would be done with any digital camera.
    If you have failed to use the device as designed it may be too late to recovery anything.
    Is the device regularly backed up to a computer via iTunes?  If so, the most recent backup (when restored to a replacement iOS device) should contain all contacts and pictures as of when the backup was created.

  • How can I use my Apple ID with 2 Apple devices?

    I just got an ipad mini and I registered it with the same Apple ID I use for my iphone 4s. Everything was fine until I downloaded apps to the ipad and noticed that the ones I had on both devices  no longer opened on my iphone. Why is this? How can I use my Apple ID with 2 Apple devices and how can I recover my apps on my iphone?

    I've had an iPad for almost two years. When I purchased an iPhone last fall I set it up to use the same Apple ID as my iPhone. I've had no problems doing this. Try resetting each device and see what happens.
    First thing to try is to reset your device. Press and hold the Home and Sleep buttons simultaneously ignoring the red slider should one appear until the Apple logo appears. Let go of the buttons and let the device restart. See if that fixes your problem.

  • How can i use my apple ID with the itune store over my windows laptop

    how can i use my apple ID with the itune store over my windows laptop

    If you don't have iTunes installed on your laptop then you can download and install it from here : http://www.apple.com/itunes/download/
    You can then log into your account on it via the Store > Sign In menu option (on iTunes 11 on a PC you can get the menus to show via control-B) :
    And you can then select the Store on the left-hand sidebar (you can enable the sidebar via control-S), and then browse items in the store and buy them by clickin on their price.

  • How can I use my time capsule with windows7

    How can I use my time capsule with windows7?

    This is asked regularly.
    https://discussions.apple.com/message/10978060#10978060
    Look at the more like this. On the right column next to the post.
    Load airport utility for windows.. which will also load bonjour for windows.
    In windows explorer type \\TCname or \\TCipaddress (replacing with the actual values.. names with spaces will give you trouble so change all names in the TC to SMB compatible or actual ip address).

  • How can we use    27" thunderbold screen with  macpro 2010 - 2011  model ?

    how can we use    27" thunderbold screen with  macpro 2010 - 2011  model ?
    regards
    paykom.com.tr
    orhan batur

    Unfortnately you cannot. Thunderbolt is an onboard chip that will require an updated Mac Pro. It is not a graphics card upgrade, but a full logicboard upgrade.
    Apple has not updated the Mac Pro in 580 days - as of this post. Hopefully one is right around the corner...but I've been hoping for that for over a year.

  • How can I use find a phone with my family members but they each have there own email

    How can I use find a phone with my family's iphone when they already have email addresses?

    Welcome to the Apple Community.
    You can't use find my phone from your phone if your other family members use another iCloud account.
    You have two options depending on why you want to find the phones.
    Use find my phone at iCloud.com on a mac/PC and log in using their account.
    Use the find my friends app

  • How can I use undo and redo with run time menu?

    Hi..I try to built my own menu for graphic programming. How can I use undo and redo in labview with run time menu?

    filozof-
    During runtime, by default, LabVIEW has undo/redo data changes under the edit menu. This will undo/redo changes made to controls during runtime. If you want a more extensive undo/redo (custom for your application), you are going to have to do quite a few things
    1) Create a custom runtime menu (Edit>>RunTime Menu) and place your own undo/redo controls on it
    2) Keep an action history in your program
    3) Catch the Shortcut menu event for your custom undo/redo controls
    4) Reverse the last action in your histroy when you catch the event
    This method would allow you undo entire operations (like resize, move, or whatever kind of functionality you are building into your application) unstead of just undoing data changes.
    Xaq

  • How can I use the QR codes with my iPad 2. do I need to download first an app ?

    How can I use the/read the QR codes with my iPad 2 ? Do I need to download an app ?

    Yes.  There are quite a few available for free in the app store

  • How can i use autoSuggestBehavior for inputText witha separator

    I use JDEVADF_11.1.1.2.0
    how can i use a input Text Field with auto suggest by sepearted
    in a field with what, is separated
    Example Value :"Name1;Name2;Name3......"
    Sorry for my English

    I'm not exactly sure what do you mean here.
    The basics of working with autosuggest are here:
    http://www.connotea.org/user/jdeveloper/tag/auto%20suggest

  • How can i use an email address with an apostrophe as my apple ID

    I need use a school email address for a new Apple ID but it has an apostrophe, and Apple does not see it as a valid address. How can I use that email?

    Welcome to the Apple Community Juduth.
    If you don't know your password, don't know your security questions and don't have a rescue address or don't receive a reset email, you should contact AppleCare who will initially try to assist you with a reset email or if unsuccessful will pass you to the security team to reset your security questions for you.
    If you are in a region that doesn't have international telephone support try contacting Apple through iTunes Store Support.

  • How can i use my Shuffle ipod with windows media player

    can i use my ipod shuffle with my windown media player and if i can how can i instal on windowns xp and vista or i need to download itunes program
    thank you
      Windows XP Pro   Windows Vista
      Windows XP Pro   Windows Vista

    can i use my ipod shuffle with my windown media
    player
    No...you can convert .wma files to mp3 or AAC in iTunes
    and if i can how can i instal on windowns xp
    and vista or i need to download itunes program
    There are potential compatibility issues with Vista and iTunes... stick to iTunes on WinXp

  • How can I use forms to create a printable document or an html page?

    This question may be a little confusing, so below is a link to an example of what I want to create using Dreamweaver.
    http://www.howard.edu/technology/info/web/hosting/request/default.htm
    On this webpage, the user is asked to fill in the forms with their info and when they press "view printable form", a html page using the info that was inputted is created for the user to print and sign.
    So, I basically want to create the exact same thing in Dreamweaver - any suggestions? Any help is greatly appreciated.
    Thanks in advance.
    Jonathan

    How can I use java to create a shortcut on a surfers
    desktop?
    A surfer clicks on a link and it creates a shortcut
    back to a certain website and/or a shortcut is created
    on load
    thanks
    You have to sign your applet to create files... and thank god too. I hate it when web pages add shiite to my desktop.

  • How can I use the setup utility with my gaming adapter?

    How can I use this program (the cd that came with my netgear wireless game adapter) to setup my gaming adapter? I want to configure my gaming adapter but it seems like i cannot do so? How can I achieve this?

    Hi again,
    thought a bit about this...
    This thing looks to me like a special sort of wireless router with one ethernet port, which also is a bit old I guess.
    With nowadays wireless router, the configuration usually is made using a Web-Browser like Safari or Firefox and accessing the router through a built-in webpage.
    The IP adress of the router is also usually 192.168.0.1.
    Have a look inside the Netgear-Documentation, to see if this also possible here.
    Stefan

Maybe you are looking for

  • All Values Deleted from Target System when transporting new values added

    Hi, Wasn't really sure where to put this question. I created a maintenance view between two Z tables. A main key table and a text table. I added the new values to the maintenance view and transported successfully. I then had a request to create 3 mor

  • Error in Starting OC4J_HOME using Enterprise Manager

    Hi, I am getting this error "oracle.sysman.emSDK.util.jdk.EMException: java.util.HashSetoracle.sysman.emSDK.util.jdk.EMException: java.util.HashSetoracle.sysman.emSDK.util.jdk.EMException: java.util.HashSet" when I try to start using StartAll in Ente

  • Acrobat 9 Pro crashing during form creation

    Acrobat 9 Pro has crashed on me several times already while trying to create a form.  I'm using a previously created pdf and the form wizard.  While I rename and adjust the fields is when it crashes - 3 times already today.  Any idea what could be ca

  • Need information related to ETL_PROC_WID Column

    Hi I am New to DAC As well as OBIA i need to know about the ETL_PROC_WID Column and it's imporatance in DAC thank's in Advance ...

  • Audio in HTML

    Hi to everyone! I've setup a website and I'd like, well the client, would like to have music on it. I don't agree with him and will try convince him not to do so. There's a slight problem, though... This is the final page: http://www.ideachecercavi.i