1- What is the difference between a thread and an object? An Object is a representation of a class that is used to expla

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

1- What is the difference between a thread and an object? An Object is a representation of a class that is used to expla

Post by answerhappygod »

1 What Is The Difference Between A Thread And An Object An Object Is A Representation Of A Class That Is Used To Expla 1
1 What Is The Difference Between A Thread And An Object An Object Is A Representation Of A Class That Is Used To Expla 1 (47.14 KiB) Viewed 14 times
1- What is the difference between a thread and an object? An Object is a representation of a class that is used to explain the class's state and behavior. A class's instance is an object. Objects can be used to access all of the class's data members and member functions. When a class is defined, no memory is allocated; nevertheless, memory is allocated when it is instantiated. In Java, a Thread is the path taken by one program throughout execution. The main thread is one of the threads in Java that is responsible for program execution. A thread is the path taken by the Java Virtual Machine (JVM) when the main method is invoked with the main thread. Java programs have at least one thread, known as the main thread, User threads & Daemon threads, Java Virtual Machine (JVM) at the program's start when the main method is invoked with the main thread. 2- Why daemon threads are needed? Daemon threads are needed in java because they are very useful for supporting tasks which are garbage collection and releasing the memory that is unused in objects and as well as removing unwanted entries from caches. Which is very important to maintain tasks in java.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply