answersLogoWhite

0


Best Answer

yes , we can create more than 2 threads for an object provided if all threads are reading the object. It will create deadlock in case multiple threads are writing into same object, hence we should not create multiple in this case.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Can we create more than 2 threads for a single object in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can you create an object of interface in java?

maybe


In relation to Java what is a thread?

A Java Thread is a thread of execution in a Java Program. A Java Virtual Machine can have a single application running multiple threads, which is known as concurrency. Threads are what make the program run. Each thread has a different priority, and when the machine queue fills up, the threads are executed in the order of their priority.


Can you initialize an object without constructor in java?

No. if you wish to create an object that you plan on using in a java program then the answer is NO. You cannot initialize an object of a Java class without calling the constructor.


What is java is so popular?

java is a machineindependent programming language. It is simple. Only java supports applets and servelets . It is completely object oriented and highly secure . It contains threads that can programing easily.


What is polymorphisam in java?

single object perfom multiple behaviour


What mean by multithreaded program?

A multithreaded program is one that has multiple threads in execution. They may execute parallel to one another or totally without relation to one another. In Java you can create multithreaded programs using Java threads.


Why thread used in java?

Threads are used in Java to run multiple operations in parallel. You can create and run multiple threads in parallel to utilize the processing power of the computer and reduce waiting time which would be high if processes are executed in sequence


In java is A string the same thing as a char?

No.A char is a single Unicode character. It is stored as a primitive (i.e., non-object) data. A string can be considered as an array of chars - Java stores it as an object.No.A char is a single Unicode character. It is stored as a primitive (i.e., non-object) data. A string can be considered as an array of chars - Java stores it as an object.No.A char is a single Unicode character. It is stored as a primitive (i.e., non-object) data. A string can be considered as an array of chars - Java stores it as an object.No.A char is a single Unicode character. It is stored as a primitive (i.e., non-object) data. A string can be considered as an array of chars - Java stores it as an object.


Can you create object in java at run time?

Yes, you just have to implement a method that creates a new object, and call it.


How oops concept is implemented in java?

OOP stands for Object Oriented Programming. Everything in Java is an Object. Any class you create extends the Object class by default thereby making everything in Java an object. Moreover, you can use features like Inheritance, Polymorphism, Encapsulation etc which are OOP concepts thereby making Java an Object Oriented Programming Language


Who create Java and when?

Who create Java & when? Why he create java ? What are mane functions of it?


Why is single thread system not used in java?

Because the developers of Java considered the possibility of multithreading a big advantage. You don't HAVE TO use multiple threads; just use it when you need it.Because the developers of Java considered the possibility of multithreading a big advantage. You don't HAVE TO use multiple threads; just use it when you need it.Because the developers of Java considered the possibility of multithreading a big advantage. You don't HAVE TO use multiple threads; just use it when you need it.Because the developers of Java considered the possibility of multithreading a big advantage. You don't HAVE TO use multiple threads; just use it when you need it.