Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Threads

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 166
    Comment on it

    Threads

    Threads are used to get the multiple activities in a single process.

    They are light weight programs.

    They share memory and files and process state.

    They have their own local variable and stack and program counter.

    Every java program creates at least one thread main()

    Other are added using the thread constructor or instantiating the classes extending the thread class.

    java.lang* package is use to run the threads.

    ex

    public class MyThread extends Thread {
       public void run(){  
        System.out.println("thread is running...");  
      } 
       public static void main(String[] args) {
         MyThread obj = new MyThread();
         obj.start();
    }
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: