Results 1 to 3 of 3

Thread: multithreading problem

  1. #1
    haris-raheem
    Guest

    multithreading problem

    can anyone tell me that how run method is called from start method of
    thread class. i dont want code but only reason

  2. #2
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    Either implement a Runnable interface or subclas thread to use it's run() method.

    Your quesiton really dosnt have an answer besides it just is. If you think about it though it makes sense. When you start somthing, you are in the process of begining to run it.

  3. #3
    VirtuallyVB
    Guest
    The Thread class "knows" about the run() method in a class that either implements Runnable (a reference is passed in the constructor) or extends Thread. So it would be the same as your own method "A()" calling another one of your own methods "B()".

    Strictly speaking, you can call run() just as any other method, but to have it run as its own thread, invoke it by start(). (This can be a question on the Exam-- and watch for run(something); that does NOT implement the Runnable interface--run() does.)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width