Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews Java Programming Language Interviews:Advanced JavaCore JavaEclipseFull Stack Developer (Java)HibernateIBM WebSphereInternationalization LocalizationJ2EEJ2MEJ2SEJavaJava ANTJava AppletJava BeansJava ClassesJava EJB ProgrammingJava Game DeveloperJava GUI FrameworkJava JNDIJava JNIJava JSP ProgrammingJava Message Service (JMS)Java Multi-ThreadingJava Networking - Sockets and RMIJava PatternsJava SecurityJava Server FacesJava Servlet ProgrammingJava Software EngineerJava Swing ProgrammingJava TechnicalJava ThreadsJava Transaction APIJava Web ServicesJavaMailJBossJDBCJMSJSFPortal and PortletRMISpring FrameworkSr.Java Web DeveloperStrutsSunOneSwing AWTSWT JFace
Copyright © 2018. All Rights Reserved
Java Multi-Threading Interview Question:
Explain Thread?
Submitted by: AdministratorWe can describe "thread" in two ways in Java.
1. An instance of class java.lang.Thread.
2. A thread of execution.
An instance of Thread is an object like all other objects in Java, it also has variables and methods and it lives and dies on the heap.
But a thread of execution is an individual light weight process that has its own call stack.
Even if you don't create any new threads in your program, threads are there running in background.
The main() method runs the main thread. So in main call stack the main() method would be the first.
When a new thread is created then it will have its own stack separate from the main() call stack.
Submitted by: Administrator
1. An instance of class java.lang.Thread.
2. A thread of execution.
An instance of Thread is an object like all other objects in Java, it also has variables and methods and it lives and dies on the heap.
But a thread of execution is an individual light weight process that has its own call stack.
Even if you don't create any new threads in your program, threads are there running in background.
The main() method runs the main thread. So in main call stack the main() method would be the first.
When a new thread is created then it will have its own stack separate from the main() call stack.
Submitted by: Administrator
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.