Description:
Multithreading in java is a process of executing multiple threads simultaneously
Learn through my videos:

Program:
package multithreading;
import java.util.logging.Level;
import java.util.logging.Logger;
public class Multithreading
 {
    public static void main(String[] args) 
    {
       A obj=new A();
       obj.start();

       B obj1=new B();
       obj1.start();
    }
}
    class A extends Thread
    {
        public void show()
        {
            for(int i=1;i<=5;i++)
            {
                try {
                    System.out.println("Hi");
                    Thread.sleep(1000);
 } 
catch (InterruptedException ex) 
{
                    Logger.getLogger(Multithreading.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        }
        public void run()
        {
            show();
        }
    }
    class B extends Thread
    {
        public void show()
        {
            for(int i=1;i<=5;i++)
            {
                try {
                    System.out.println("Hello");
 Thread.sleep(1000);
                } 
catch (InterruptedException ex)
 {
                    Logger.getLogger(Multithreading.class.getName()).log(Level.SEVERE, null, ex);
                }         
            }
        }
        public void run()
        {
            show();
        }
    }

Output:
Hi
Hello
Hi
Hello
Hi
Hello
Hi
Hello
Hi
Hello 
Logic:
The thread has two methods used thread.sleep(),and thread.run() to execute the thread.