Hi,
   see this code:

        import java.io.*;
        import java.util.*;
        import javax.servlet.*;
        import javax.servlet.http.*;


        public class ThreadTest extends HttpServlet {
                public void doGet(HttpServletRequest req,HttpServletResponse
res) throws IOException {
                        T t = new T(res.getWriter());
                        t.start();  // this is not printing any values.why?
                        t.say(); // this works well...
                }
        }
        class T extends Thread {
                PrintWriter out;
                public T(PrintWriter pwt) throws IOException{
                        this.out = pwt;
                }
                public say() {
                        out.println("Working Well----from say()");
                }
                public void run() {
                        out.println("Working Well----from Thread");
                }
        }

        This program prints only for say() method, whereas it is not
printing anything when i call this thru thread.
        can any one tell why .......?


Regards,
Balamurugan K,

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to