Help me with how to access accessor!!!

hi my code is..
import java.lang.*;
import java.util.*;
import java.io.*;
class testStudentIterator
     public static void main(String args[])
          TreeMap stuTree = new TreeMap();
          student myStudent1= new student(1111,"AAA");
          stuTree.put("1",myStudent1);
          student myStudent2= new student(2222,"BBB");
          stuTree.put("2",myStudent2);
          Collection allStudents = stuTree.values();
          Iterator stuIterator = allStudents.iterator();
          while (stuIterator.hasNext()) {
               System.out.println(stuIterator.next());
class student
     private int stuID;
     private String stuName;
     student()
          stuID=0;
          stuName="unknown";
     student(int iD, String name)
          stuID=iD;
          stuName=name;
     public String toString()
          String info="Student ID : "+ stuID;
          return info;
     public String getStuName()
          return stuName;
}and i want to use accessor to explicilty print the student's name only
but i don't know how to access it..

Feels a lot like homework, but what the heck...
Instead of
while (stuIterator.hasNext()) {
  System.out.println(stuIterator.next());
}you might want
while (stuIterator.hasNext()) {
  student s = (student) stuIterator.next()) // Classnames begin with upper-case letters!
  System.out.println(s.getStuName());
}

Similar Messages

  • PLEASE HELP ME.  Some important emails have gone to an archive mail box and i really need them.  Can someone please help me with how to view the archive email box and the emails that are in there?

    PLEASE HELP ME.  Some important emails have gone to an archive mail box and i really need them.  Can someone please help me with how to view the archive email box and the emails that are in there?

    http://kb.mozillazine.org/Recovering_deleted_mail_accounts

  • Can anyone help me with how to install itunes on windows 8.  The apple techs suggestions did not work

    Can anyone help me with how to install itunes on windows 8.  The apple techs suggestions didn't work.  Spent most of today installing and uninstalling itunes according to their instructions.  They will charge me again if I call again.

    When I run the iTunes64setup.exe it says: "The thingy is not a valid win32 application."
    That generally indicates that the installer has been getting damaged on the download.
    What web browser have you been using for downloading the iTunes64Setup.exe? Does it make any difference if you use Firefox instead of IE for the download (or vice versa)?

  • Need Help Figuring Out How to Access On/Off Field in Upper Left Hand Corner

    I am hoping someone can help as I am not at all TECHNICALLY SAVVY!!  I must have hit some wrong button yestyerday because now I cannot get access to my messages on my Blackberry Curve.  I think it may be because the word OFF appears at the top of the screen on my Blackberry on the far left hand side and I cannot figure out how to access that part of the screen to change it to say ON.

    Well, give it a few minutes, and if after 15 minutes no new email messages, Do a simple reboot on the BlackBerry in this manner: With the BlackBerry device POWERED ON, remove the battery for a minute, and then reinsert the battery to reboot. A reboot in this manner is prescribed for most glitches and operating system errors, and you will lose no data on the device doing this.
    Meanwhile, if you've read or deleted any of the email sent in the interim from your PC, you won't be getting it on your BlackBerry.
    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

  • Need help/guidance with how to add a rescue email to my apple ID

    Ive been unable to access my itunes account because it keeps on asking me for my security questions (which i have never been asked before) I have unfortunetly forgotten the answers and realize that i can send myself an email with the answers. However i didnt add a rescue email when making my apple ID so could someone walk me through the steps as to how to do this now.
    thanks

    You won't be able to add a rescue email address until you can answer your questions, you will need to contact Support in your country to get the questions reset.
    Contacting Apple about account security : http://support.apple.com/kb/HT5699
    When they've been reset you can then use steps 1 to 7 half-way down this page to add a rescue email address for potential future use : http://support.apple.com/kb/HT5312
    Navigate to appleid.apple.com using your web browser.
    Click "Manage your account"
    When prompted, sign in using your Apple ID and password.
    Click Password & Security
    You'll be asked to answer 2 of your 3 security questions before you can make any modifications. If you are unable to remember your answers, you can choose to send an email to your rescue email to reset your security questions.
    After you've validated your identity by correctly answering your security questions, click Edit to the right of your rescue email address.
    Once you've finished editing your rescue email address, click the Save button directly below the email field.

  • Help!! how to access JTextArea in JScrolPane inside JTabbedPane

    hi there my problem is i want to access setFont method of JTextArea inside JScrolPane which is also inside a JTabbedPane
    here is my code in creating new tabPane:
    if(e.getSource() == createNewTabButton){
    //instance variable editorTab = new JTabbedPane
    editorTab.addTab("Title", new JScrollPane( new JTextArea(18,51) );
    how do i use this code to set the font for every JTextArea in every Tab:
    editorTab.getSelectedComponent()./* i dont know what goes here* /.setFont(new Font(....));
    thanks..

    hi there my problem is i want to access setFont
    method of JTextArea inside JScrolPane which is also
    inside a JTabbedPane
    here is my code in creating new tabPane:
    if(e.getSource() == createNewTabButton){
    //instance variable editorTab = new JTabbedPane
    ditorTab.addTab("Title", new JScrollPane( new
    JTextArea(18,51) );
    how do i use this code to set the font for every
    JTextArea in every Tab:
    editorTab.getSelectedComponent()./* i dont know
    what goes here* /.setFont(new Font(....));
    thanks..This is the only way i could get it to work....
    UIManager.put("TextArea.font", new Font("Trebuchet MS", Font.PLAIN, 32));//overrides the look and feel properties or something
    SwingUtilities.updateComponentTreeUI(editorTab.getSelectedComponent());  //this takes your selected component and applies your font settings to it

  • Help needed with domparsers for accessing TextNode value

    Hi,
    My input appears like this.
    <header>
    <Data>bhargav</Data>
    <header>
    i need to write a java mapping code where i need to access the value of <Data>.It is a type String and Category is element.In my java code i need to take this content of <Data> into a String.
    Thanks in advance,
    Bhargav
    Message was edited by:
            bhargav gundabolu

    Hi,
    Im using this java mapping to solve the level-2 hierarchical issue that occures with content conversion.I have written my java mapping using domparsers and StreamTransformation. and the output is coming fine.But in one case i need to access the value of the <Data> node and make some changes to it.But im unable to do it as <Data> here is a text node.
    Thanks,
    Bhargav

  • Help Needed with XML Attribute Access (Bold/Italics)

    Hi,
    I have a form that displays data in livecycle designer. When someone imports an xml file into the form in Adobe Acrobat it should be able to display some data as bolded and some italicized based on the xml file.
    Here is the sample xml file
    <Table1>
         <Row1>
              <Cell1 style="none">1</Cell1>
              <Cell2 style="bold">2</Cell2>
              <Cell3 style="italics">3</Cell3>
         </Row1>
    </Table1>
    And the output should be:
    1 2 3 
    Can someone please help! If the xml file should be designed differently please let me know.
    Thank you!

    Paul,
    Thanks for the help! I tried it out and it worked. One last question please. According to your explanation I added to the xml file the tags
    <body xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/" xmlns="http://www.w3.org/1999/xhtml" xfa:APIVersion="Acroform:2.7.0.0" xfa:spec="2.1">
    <p style="font-weight:bold;">2</p>
    </body>
    do I need to place this body tag around each number or can I place it in one location in the xml file?
    Thanks again.

  • Plz help me with how to play video messages?

    i speaking video call when save this video hack or no hack plz not releas videos
    This post was transferred from its previous location to create its own new topic here; its subject and/or title has been edited to differentiate the post from other inquiries and to reflect the post's content. A link to this post appears where the post was originally added.

    What's The Problem Dear,Can You Please Elaborate?

  • How to access hidden fields in a table

    hi
          what is the use of hidden fields in a table, ie. some fields doesn't visible in the field list of a table.  but the fileds will be visible if u display its contents.
        for example in table t518A the text field is not visible in the field list.  But it will be visible if display its contents.  can any one of u please help me out how to access those fields. 
    regards
    sri

    Hi Srivallika,
    The table T518A has a text table called T518B. You can have a look at this table by:-
    1. GOTO SE11 and display table T518A.
    2. GOTO menu GOTO -> TEXT table. It gives the text table for the given table. Here its is T518B.
    A Text table is table with same key fields as the main table with another extra Language key TYPE SPRAS. This table is related to the main table. Hence to access the extra text fields, you can use the TEXT table :).
    Thanks and regards,
    Ravi.
    NOTE: Points keep me alive on SDN .

  • Help Please with Wii

    I have a Mac OSX 10.6.3 and would like to connect my Wii game to it for the purpose of playing iTunes radio stations from the Wii in a different room than the room the Mac is in. I would like to use either Bluetooth or Airport.....or for that fact I guess any way to connect the Wii to my computer wireless to play music.
    Q- Can anyone please help me with how to do this ? What steps do I need to take.
    Thank you for any help.

    There are no "iTunes Radio Stations" as such. If you're referring to the stations listed in the Radio section of iTunes, as I presume you are, those are independent stations being streamed from some other server and do not need iTunes at all. So if your Wii is capable of accessing streaming radio, it should be able to connect to them directly (if the Wii doesn't have a similar list of stations, looking up the station via the web and then finding their direct link should get you going). How to do that would be a question best taken up on a Wii-related web site, as would your question about how to use your Wii with a wireless network.
    Regards.

  • Immediate help required with this job scheduling scenario

    I have a job that needs to run a procedure hourly but not between 6:00 AM to 8:00 AM and 6:00 PM to 8:00 PM.
    Can anyone help me with how to schedule this job.

    If you use a window the job would only execute if the window opens. If for some reason the window did not open then the job would not execute.
    Windows should be used to specify which resource plan should be active for the time interval.
    In this case you are better off using FREQ=DAILY; BYHOUR=; and specify the hours.

  • How to access the hidden variable in jsp

    hi all,
    i need help to know how to access the hidden variable in the same jsp.
    Following is the code snippet just have a look at that.
    ArrayList arrRankingSummary = (java.util.ArrayList)session.getAttribute("arrRankingSummary");
    <logic:iterate id="rankingSummary" name="arrRankingSummary">
    <input type="hidden" name="allApplicantID" value='<bean:write name="rankingSummary" property="APPLICANTID"/>' />
    <input type="hidden" name="allAdmissionRank" value='<bean:write name="rankingSummary" property="ADMISSIONRANK"/>' />
    </logic:iterate>
    <input type="hidden" name="applicantID" value='<bean:write name="rankingSummary" property="APPLICANTID"/>' />
    <TD align=center><Input type=Text name="admissionRank" class=Textverysmall size=2 value='<bean:write name="rankingSummary" property="ADMISSIONRANK"/>' maxlength="10" /> </TD>
    I want to remove the element from arraylist on these condition
    if(allApplicantID.value ==applicantID.value){
    arrRankingSummary .remove("admissionRank");
    Now the pbm is i m not getting how to access the hidden variable in jsp or how to use the values of hidden variable for the condition.
    Pls help me out.
    Thanks in adv.
    Regards,
    Ritu

    hi ram,
    as i mentioned i m creating hidden variables & i m doing some validation on form submit.
    The following is js code snippet for validation.
    for (var i = 0; i < document.forms[0].admissionRank.length; i++)
    admissionRank = document.forms[0].admissionRank.value;
    for(var j = 0; j < document.forms[0].allAdmissionRank.length; j++)
    //alert ("admissionRank : " + admissionRank + " document.forms[0].allAdmissionRank[" + j + "].value : " + document.forms[0].allAdmissionRank[j].value + "\ndocument.forms[0].allApplicantID[" + j + "].value : " + document.forms[0].allApplicantID[j].value + " document.forms[0].applicantID[" + i + "].value : " + document.forms[0].applicantID[i].value);
    if(admissionRank == document.forms[0].allAdmissionRank[j].value && document.forms[0].allApplicantID[j].value != document.forms[0].applicantID[i].value && admissionRank != "" && document.forms[0].allAdmissionRank[j].value != "")
    flag = false;
    document.forms[0].admissionRank[i].focus();
    document.forms[0].admissionRank[i].select();
    break;
    if (flag == false)
    break;
    In this validation i want admissionRank to be removed from the original arraylist if following condition gets satisfied
    "(document.forms[0].allApplicantID[j].value == document.forms[0].applicantID[i].value )"
    Thanks in adv
    Ritu

  • How to access the activities created by an enduser especially when the enduser has left the organization?Please help me out with the possible solution

    How to access the activities created by an end user especially when the end user has left the organization?Please help me out with the possible solution

    Hi Ramesh,
    In the web UI we have business role IC_manger where you can search the activities based on employee responsible and you can use business transaction assignment functionality to assign those activities to any  other end user or team.
    Else you can also use Agent inbox functionality if you have configure the agent inbox for those activity.
    Hope this helps solving your query

  • Help required with Photoshop Elements 4.0 this has been installed on my new Toshiba laptop with windows 8.1 for some 18 months and operating well. Now it will not open, message pops up saying "attempt to access invalid address" then "application not respo

    Help required with Photoshop Elements 4.0 this has been installed on my new Toshiba laptop with windows 8.1 for some 18 months and operating well. Now it will not open, message pops up saying “attempt to access invalid address” then “application not responding” Suggestions how to access would be much appreciated. Tks. Stuart

    What is the size of your hard disk?  PSE 4 is a very old program and I suspect it is not able to access the entire hard disk on your machine.  Just a thought here.

Maybe you are looking for

  • Outlook 2010 x64 PDF Attachments not opening 11.0.09

    Computer Specs Windows 7 x64 SP1 with latest updates Acrobat 11.0.09 Update Office 2010 x64 with latest updates Problem is in outlook when double clicking a PDF attachment, the circle appears like it's thinking to open but then nothing happens.  If I

  • From MAC to windows

    Hi, I just loaded all of my songs onto my new iPod using my Mac Powerbook. I also loaded all of the same playlists onto my wife's new iPod Nano from my Powerbook. She doesn't use Mac, she uses Windows. Now, she wants to add songs to her Nano from her

  • Slow Disks After Cluster Creation

    Hi, I have a Windows Server 2008R2 SP1 cluster, consisting of two VMWare virtual servers, which is experiencing very slow disk performance (~10mb/s when copying to or from any of the cluster disks). If I destroy the cluster and bring the disks online

  • Consume a Web Service in ABAP

    Hi, We have a Web Service URL on PI. Run time of this Web Service in a Portal Server. We need to access the Same URL from ECC using ABAP Programming? Can any one tell me how we can call the same Web Service? I need to pass few values to the web servi

  • My empty folder won't delete, even though I have full admin priveleges?

    I have been trying to get rid of this folder that i created not too long ago, the folder is now empty but I am unable to delete it. when i right click>move to trash it prompts me for my password, which i then enter and receive this frustrating messag