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

  • Excise invoice camcelation from sd

    Dear all , When i tried to cancel excise invoice for t code  j1ih through  system giving error : "Excise modvat accounts not defined for CEIV transaction and  excise group" Then i check "Tax on goods movement " all g/ assignment  for CEIV  transction

  • How to store multiline string literal in to java bean shell variable

    Hello Experts How to store multiline string literals in java bean shell like we use triple quote for jython variable Using Jython str=""" helllo welcome to my world""" above syntax is working but not for java bean shell like below String str=""" hell

  • MCB_ is not working correctly to set the keys

    Hi, I am using transaction MCB_ to set the transaction keys but the screen comes up with blank blue screen and an error: <b>View/table V_TMCLBW can only be displayed and maintained with restrictions</b> I then went to SM30 to maintain table V_TMCLBW,

  • White region in the screen

    Hi all, I am noticing that when I am opening and closing the lid of my t400... there is a zone on the screen which seems to be like glowing (like when you touch the screen by the finger, but without touching it) and after some time this area has beco

  • SOAP Threads

    Has everyone seen the same, Platform is OES2 sp1 64 bit and GW version is 8.0.1 I have set SOAP threads to 18 and monitor tells me 48 (at poa monitor) and all them are busy, we using gms 2.0 , yesterday it was 80 and 80 was busy, this morning I need