By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,032 Members | 825 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,032 IT Pros & Developers. It's quick & easy.

InputStreamReader help please

JavaStudent07
P: 64
I had an assignment, on the command prompt, enter a filename of a previously formed program and print it out with numbered lines
IE*
1 public *********
2 {
3 Code
4 }

ETC.
Jan 22 '07 #1
Share this Question
Share on Google+
8 Replies


JavaStudent07
P: 64
if you could just leave a piece of code, I will check it during class tommorow

THANKS,
Steve
Jan 22 '07 #2

DeMan
100+
P: 1,806
And mark it for me?
Jan 22 '07 #3

10K+
P: 13,264
I had an assignment, on the command prompt, enter a filename of a previously formed program and print it out with numbered lines
IE*
1 public *********
2 {
3 Code
4 }

ETC.
Do not use InputStreamReader for this. Use a Scanner if you have jdk 1.5 or a BufferedReader and a FileReader. No one is going to write code for you if you are not willing to at least give it a try. Post some code and point out your exact problem and you will see how much help you'll start getting.
Jan 23 '07 #4

JavaStudent07
P: 64
sorry not sure how this site goes, im a newbie...
Jan 23 '07 #5

JavaStudent07
P: 64
by the way, my friend figured it out, it's two pages of code for that...it seems more simple but it works his way, thanks anyway...

Steve
Jan 23 '07 #6

10K+
P: 13,264
by the way, my friend figured it out, it's two pages of code for that...it seems more simple but it works his way, thanks anyway...

Steve
Two pages is way too much. You should not write more than 15 lines of code for this. Also now that your friend has done it for you, perhaps you did not benefit as much as you would have if you had tried it yourself and asked for help and explanations where you got stuck. If he/she used two pages for it then there is something seriously wrong with that solution.
Jan 23 '07 #7

JavaStudent07
P: 64
lol, he got the code out of a book but alright :) I figured it was too much, I am just looking for a faster way to do it, I have no starting code.

thanks,
I will be on tommorow again,
Steve
Jan 23 '07 #8

10K+
P: 13,264
lol, he got the code out of a book but alright :) I figured it was too much, I am just looking for a faster way to do it, I have no starting code.

thanks,
I will be on tommorow again,
Steve
Just read about how to use a scanner to read a file then try to write this program yourself and post the code if you have any problems.
Jan 24 '07 #9

Post your reply

Sign in to post your reply or Sign up for a free account.