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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:30:17+00:00 2026-06-14T15:30:17+00:00

I have a issue i can’t get it to work now let going to

  • 0

I have a issue i can’t get it to work now let going to the point a explain in the code thanks.

This is my class: what I want to do is insert the Integers sort the list and buffer writer in a column with out coma. Now I getting this:
[1110018, 1110032, 1110056, 1110059, 1110063, 1110085, 1110096, 1110123, 1110125, 1110185, 1110456, 1110459]

I want like this:
111xxxxx
111xxxx
xxxx…….

I can’t do it in single array, have to be in ArrayList.
This is my collecting:
list.addNumbers(numbers);
list.display();

This is my writer: Is buffered
coma.write(“\n”+list.display());

coma.flush();

**public class IdCount {
private ArrayList properNumber = new ArrayList<>();

 public void addNumbers(Integer numbers) {<br/>
properNumber.add(numbers);**<br/>  

Collections.sort(properNumber);
}
public String display() {
(I try .toString() Not work)
return properNumber.toString();

      }**  

My second issue is LineNumberReader: This is my collecting and my writing:
try {
Reader input = new BufferedReader( new FileReader(inputFile));
try (Scanner in = new Scanner(input)) {
while (in.hasNext()) {
(More Code)
asp = new LineNumberReader(input);
int rom = 0;

              while (asp.readLine()!=null){<br/>
                  rom++;<br/>
              }
          System.out.println(rom);<br/>coma.write(rom);<br/>

This one not write anything an my System Print give me only 12 0 in column.
Thank you for the help in advances. Any help it will appreciate.

  • 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-14T15:30:18+00:00Added an answer on June 14, 2026 at 3:30 pm

    I want like this:
    111xxxxx
    111xxxx
    xxxx…….

    Then in write your display method as follows:

    public String display() {
      StringBuilder sb = new StringBuilder();
      Iterator i = properNumber.iterator();
      while(i.hasNext()){
       sb.append(i.next);
       sb.append("\n");
      }
    
      return sb.toString();
    }
    

    Explanation:

    What you were doing :

    return properNumber.toString(); will return a string that contains all values inside properNumber comma-seperated. so thats why you were getting that output.

    What I have done

    Made a StringBuilder object so that I can temporarily store the strings before returning all the values.

    Then I made a iterator that iterates through properNumber and then append each entry to the StringBuilder object and appending \n after it.

    Finally when the iterator completes meaning I have added all entries inside properNumber in StringBuilder object sb. So now I will return the content of sb as String using sb.toString() method.

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

Sidebar

Related Questions

I have this issue that I can't seem to get my head around... Basically
I have this exact issue ASP.net can’t update page from event handler and it's
Heyy can somebody help me ? i have this issue that still do know
I have a jQuery issue I can't get past: (function ($) { var links
I'm pretty new to Rails and have an issue which I can't quite get
I have an issue that people can't work with an intranet application that is
I have narrowed done my problem to small sample where this issue can be
I have an issue I can't get over. I made a simple jQuery album
I have an issue in that a Symfony2 form can pass validation but still
I have a slight issue where I can't seem to select a User Control

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.