What is a thread in Java?
A thread in Java is a process that executes in parallel with other processes, creating separate independent units of execution.
Actually, a thread is not an independent process. It is a smaller unit of a process that shares the process's memory space with other threads.
Can you explain how multiple threads can share memory in Java?