Urgent Help On Java Project - Tech Jobs - Nairaland
Nairaland Forum › Science/Technology › Programming › Tech Jobs › Urgent Help On Java Project (895 Views)
1 Reply
| Urgent Help On Java Project by bigboyslim(op): 11:28pm On Oct 24, 2008 |
hi, I have a class project that is due in 4 days and I still dont know if i'm going about it the right way. Would really appreciate if java gurus can help out. The assignment is to write a program that reads lines from stdin and dynamically allocate storage for the entire set of lines read. I am not allowed to use any of the java storage facilities to manage the data storage memory ie i cant use ArrayList. it must all be done by hand. Hints provided - use a byte array for the character storage - pick one of the simplest java input facilities to read characters from stdin and treat as bytes I tried to go about this using the following steps but got stuck. - Read the input lines and stored them in a string array - tried to convert each of the characters in the string into byte and store in a byte array. i think i'm going about this the wrong way so guys, your input would be appreciated. |
| Re: Urgent Help On Java Project by javarules(m): 8:33am On Oct 28, 2008 |
I hope this help. It converts Strings to bytes public class Stringy {But to dynamically allocate Storage(I heard pointers ringing in my ears), you are better with C. using java you could use pointers too. this is a code that utilises this
Visit http://naijadukes.net with your questions, you get faster responses there as long as its java question, I hope this solution is not too late. Today is 4 days already Ciao |
| Re: Urgent Help On Java Project by bigboyslim(op): 6:23pm On Oct 28, 2008 |
Thanks for your reply. and yea today is submission date but luckily I managed to find an i/o facility that works well for my intended purpose. I used System.in.read() to retrieve characters one at a time. It retrieves the characters as integers so all I had to do was cast the retrieved characters as bytes and i processed them one at a time. Thanks for your effort though it came a bit late . |
Where Can I Download A Complete Video Tutorial On Java Programming. • Co-programming Partner In A Java Project Needed • Help Needed With Java Project Urgently ( I Will Pay) • 2 • 3 • 4
Hire A Freelancer Web Apps And Software Developer • Experienced .net Programmers Wanted For A Corporate Application Project • Urgent! I Need A Very Good Programmer In Php.
);
.