Question: how many ways to create Thread and which one is good? runnable interface or Thread class?
Answer: Two ways to create threads 1. By creating thread class class class name extends Thread { } 2.By converting class to thread ie using Runnable interface
Question:
how many ways to create Thread and which one is good? runnable interface or Thread class? Answer:
Two ways to create threads 1. By creating thread class class class name extends Thread { } 2.By converting class to thread ie using Runnable interface Source: CoolInterview.com
creating the thread by runnaable interface is best way of creating interface.b'cas class can not be extends more than one times. Source: CoolInterview.com