The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
April 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

How to join you?Ask you a small question!

Posted by sa wa on June 15, 2001 at 4:08 AM

I meet a problem in java programming:
In a socket programming, I created a thread for each new client who login. Before each thread(server side)exit, it wrote some variable values plus transaction-over time into a file(say, note.txt).All thread wrote into the same file.
The problem is : the times recorded in the file always updated automatically for all the records who actually belong to different threads. Thus although each thread exit at different time, they show the same time points in the common file.
I used "outfile.println(new Date().getTime() )", where outFile is of "new PrintWriter(new FileOutputStream(note.txt)).

Anyone could give me any hints?

Thank you very much!

> Hi,

> yes, there is a newsgroup in yahoo with about 280 people who are reading the book and commenting the exercises.
> www.groups.yahoo.com
> The group is JavaThink
> You can find there the answers of the exercises too.

> Regards
> Ivan.

> > I want to get some exercises when I studying Mr.Eckel's Thinking in Java because I could not understand it well sometime. Is there anyone can help me?

> > thank you

> > Stiven





Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us