3

Possible Duplicate:
Why java.lang.Object is not abstract?

I never need to make a object of Object Class an It think a lot of programmer have not done this thing before. If you ever need to make a Object class then please share that condition otherwise I want to know why Object Class is not abstract while we never make object of Object class.

Community
  • 1
  • 1
Anuj Jindal
  • 1,711
  • 15
  • 24

2 Answers2

4

I do create objects of type Object which are very useful when using locks in multithreading applications. This perfectly answers the question, I need an object of any type that I can lock on and the first thing that comes to mind is Object

public class MultiThreadedClass{
     Object lock = new Object();
     // ...
     public void useSharedResource(){
          synchronized(lock){
              ...
          }
     }
}
GETah
  • 20,922
  • 7
  • 61
  • 103
2

I have actually created a new Objects to use for synchronization & locking.

ControlAltDel
  • 33,923
  • 10
  • 53
  • 80