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 8954163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:15:24+00:00 2026-06-15T14:15:24+00:00

I got an arraylist made containing two letters and one number. I need to

  • 0

I got an arraylist made containing two letters and one number. I need to display it like for example “ab1”. But everytime I get a printline with some arraylist code: “pp4main.Letter@f7e6a96pp4”

This is my array list: ArrayList<Letter> letterlijst = new ArrayList<Letter>();

My code trying to display:

public Kofferslot(char letter1, char letter2, int cijfer){

    Letter letterlijst1 = new Letter();
    letterlijst1.setLetter(letter1);
    Letter letterlijst2 = new Letter();
    letterlijst1.setLetter(letter2);

    letterlijst.add(letterlijst1);
    letterlijst.add(letterlijst2);


    Cijfer cijfer3 = new Cijfer();
    cijfer3.setCijfer(cijfer);

    String letterstring1 = letterlijst.get(0).toString();
    String letterstring2 = letterlijst.get(1).toString();

    System.out.println(letterstring1 + letterstring2 + cijfer3);
}
  • 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-15T14:15:25+00:00Added an answer on June 15, 2026 at 2:15 pm

    override toString() in your Letter class, By default Object’s toString() will be invoked

     @override
     public String toString() {
           return ""+ch1+ch2+number
      }
    

    Where ch1, ch2 are the char attributes in your Letter class and number is an int attribute

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a number of paths like in memory (contained in an ArrayList): C:\Program
I've got something like this: wifiNetworks = (ArrayList<ScanResult>) mWifiManager.getScanResults(); Now I can simply get
I'm in the need of a two dimensional matrix of list, e.g. ArrayList, and
I've got an arraylist with objects, now I need to sort them. I've got
I've got an ArrayList that I'm iterating over several times, and it looks like
I got the following problem: I made a custom list CustomList which extends ArrayList
I've got an ArrayList which contains a number of sound files as elements. A
I've got two ArrayList of String and i want to count words that are
I've got an ArrayList that can sometimes contain the values Time (GMT), None, and
I've got an existing ArrayList which will be filtered according to certain criteria. I'm

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.