Multi-threading 1. What is a Thread in Java? A thread in Java is a lightweight process that runs within another process or thread. It is an independent path of execution in an application. JVM gives each thread its own method-call stack. When we start JVM, Java starts one thread. This thread calls the main method of the class passed in argument to java call. 2. What is the priority of a Thread and how it is used in scheduling? In Java, every Thread has a priority. This priority is specified as a number between 1 to 10. Scheduler in Java schedules different threads based on the priority of a thread. It is also known as pre-emptive scheduling. The thread with higher priority gets preference in execution over a thread with lower priority. 3. What is the default priority of a thread in Java? In Java, a new thread gets the same priority as the priority of the parent thread that creates it. Default priority of a thread is 5 (NORM_PRIORITY). 4. What are the three...
Top 1000+ Interview Question Java JSP Spring Hibernate java collection multithreading java string serialization and desensitization final keyword in java package java design patterns maven git repository cloud computation UNIX shell interview question