Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,151,410 members, 7,812,215 topics. Date: Monday, 29 April 2024 at 10:09 AM |
Nairaland Forum / Science/Technology / Programming / Software/Programmer Market / Urgent Help On Java Project (820 Views)
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)
(1) (Reply)
Urgent Help On Java Project by bigboyslim(m): 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(m): 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 . |
(1) (Reply)
Sql Server Developer Seeking An Interesting Career Change / Cargo Tracking System, Shipping/ Courier Tracking System / E-commerce App For Fastfood Outlet URGENTLY needed!!!
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 17 |