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,703
  • 15
  • 23

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,414
  • 7
  • 55
  • 100
2

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

ControlAltDel
  • 32,042
  • 9
  • 48
  • 75