Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8635767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:03:27+00:00 2026-06-12T10:03:27+00:00

I am currently building an address book. I am storing each entry into the

  • 0

I am currently building an address book. I am storing each entry into the address book as an object. My problem is that I cannot figure out how to get any specific variable from an object and display it. Such as the firstName for example. It’s supposed to write the variables to a file which will be loaded into the array when the program is started again.

        class ExitListener implements ActionListener{
    public void actionPerformed(ActionEvent e){
        try {
            PrintWriter output = new PrintWriter(FILE);
            ListIterator it1 = set.listIterator();
            while (it1.hasNext()){


            }
            output.flush();
            output.close();


        } catch (FileNotFoundException e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
        }
        System.exit(0);
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T10:03:29+00:00Added an answer on June 12, 2026 at 10:03 am

    I’m going to have to apply my psychic debugging powers here, as you haven’t presented any code. My guess is that you’ve got a variable like this:

    LinkedList list = new LinkedList();
    list.add(new Person());
    ...
    Object fetched = list.getFirst();
    // Problems...
    

    If you use generics, this becomes:

    // Or use an interface type, of course
    LinkedList<Person> list = new LinkedList<Person>();
    list.add(new Person());
    ...
    Person fetched = list.getFirst();
    System.out.println(person.getFirstName()); // Hooray!
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently building an app that runs on mobile phones not related to the issue
We're currently building multiple copies of our Chrome CRX, one for each of our
I am currently building a tool which creates SharePoint sites automatically. Each site must
I'm currently building a Web Service that sends files this also obtains the mime-type
I am currently working on building a system for my client that could be
Currently building a WPF app that will run in an environment where the user
I'm currently building a web application that uses a combination of OpenID and uname/pw
I am currently building a small crm application. I need each user to be
I have a web app that you can currently log into with either your
We are currently building a web-based application that has the need to associate a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.