• Post Reply Bookmark Topic Watch Topic
  • New Topic

Paginated content  RSS feed

 
Ivan Holmes
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a problem, can you help me do such program. It should do the following: If I enter the console one, I deduced the first ten files, or rather their contents (files taken from a folder, this is the usual txt files) if I brought two, I output the next ten, and so long as the files in the folder does not run out.) I have the following code so far, perhaps it will help you somehow:


You think this is a trifling task, thanks in advance for your answers)
If you can help, it will be grateful)))
If I'm not out there somewhere question asked, you move, please do not delete
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66304
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please do not post the same question more than once.
 
James Boswell
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So what happens when you run your code?

You may run into problems as when an exception is encountered, you are simply printing the stacktrace and carrying on.
 
Tony Docherty
Bartender
Posts: 3271
82
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a problem,

Ok, would you like to tell us what it is?

I can see:
1. You are iterating over all the files in the directory and not just 10
2. Line 18 should be len = list.length;
3. As James has already said your exception handling is suspect
4. You aren't closing any of the streams you have opened.
 
Ivan Holmes
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your answers, but I did not mean it, I asked you to send me the code, and the code above cited as an example, a clue. Actually, ideally I need it to be a servlet, supposedly one clicks on the link in the servlet and the content appears first ten files, so if you write me, I would be very very very happy and grateful, just very necessary. Suddenly there are good people ready to just write the code and at the same time to practice))
 
Ivan Holmes
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the advice the next time I will create a single topic in the right place))
 
Tony Docherty
Bartender
Posts: 3271
82
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I asked you to send me the code

We are NotACodeMill (← click) but we will advise you on how to write the code yourself.

 
Ivan Holmes
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did not write it, sorry can tell me examples of where there is such a solution of my question
 
Tony Docherty
Bartender
Posts: 3271
82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did not write it

The point is you are supposed to write it yourself and not get someone else to do it for you.

sorry can tell me examples of where there is such a solution of my question

That's what sites like google are for.
 
Ivan Holmes
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry ((these people did not have
 
Tony Docherty
Bartender
Posts: 3271
82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you not want to write it yourself?
If you get stuck we will try to help but we won't just write it for you.
 
Ivan Holmes
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not understand how to write it, I thought you email me this servlet, the business is there for five minutes, I really need this program.
 
Tony Docherty
Bartender
Posts: 3271
82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not understand how to write it, I thought you email me this servlet,

You will need to pay someone to write code for you.
 
Ivan Holmes
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've written on the Russian site (I'm from Russia), and I did it once without deneg.I wrote code
 
Ivan Holmes
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've written on the Russian site (I'm from Russia), and I immediately made it without any money. And code
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!