hai i want to create 3 separate threads for different tasks in my program . how can i differentiate them in the run() method

Create three different classes each of them implementing the Runnable interface, each of them having their own relevant run() method. Create a driver class which would create an instance of the three classes, pass the instance to the constructor of Thread, call the start() method of the thread and you are good to go.

Read this.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.