Question
Explain multithreading in Java ?

Answers

1. Multithreading provides better interaction with the user by distribution of task
2. Threads in Java appear to run concurrently, so it provides simulation for simultaneous activities.
The processor runs each thread for a short time and switches among the threads to simulate sim-ultaneous execution (context-switching) and it make appears that each thread has its own processor.By using this feature, users can make it appear as if multiple tasks are occurring simultaneously when, in fact, each is
running for only a brief time before the context is switched to the next thread.
3. We can do other things while waiting for slow I/O operations.
In the java.iopackage, the class InputStreamhas a method, read(), that blocks until a byte is read from the stream or until an IOExceptionis thrown. The thread that executes this method cannot do anything elsewhile awaiting the arrival of another byte on the stream.   Your Comment




More Software,Java Questions..
What is the inputsplit in map reduce software?

Can variables be used in Java without initialization?

What is the difference between java bean and enterprise java bean?

What is software configuration management?

How does the java database connectivity (jdbc) work?

What are the advantages of threads in java?

What Is Java Api For Xml-based Rpc (jax-rpc)?

How can you implement fine-grained auditing?

What is IBM’s simple explanation for Big Data’s four critical features?

What is static synchronized method in JDBC API? Give an example?

What does the NULLIF function do?

What happens if a start method is not invoked and the run method is directly invoked?

Should we override finalize method

what is the difference between mysql_fetch_array and mysql_fetch_object?

How will XML affect my document links?

What is object cloning in Java?

Why to use Style Sheets?

What are Filters in MVC?

Can you explain Application layer in OSI model?

How to define new testplan attributes?



Search
Can you Answer!!
  • Q The Treaty of Purandar between Shivaji & Jai Singh was signed in?
  • Q What was the first metal used by Vedic People?
  • Q Which is a primary disadvantage of a solid-state amplifier compared with a vacuum-tube amplifier?
  • Q Summarize the physiology of vision.
  • Q In a rechargeable cell what kind of energy is stored within the cell?
  • Q Accounting for VC money in financials?
  • Q You are creating an ASP.NET application for TestKing. An earlier version of the application uses ActiveX components that are written in Visual Basic 6.0. The new ASP.NET application will continue to use the ActiveX components. You want the marshaling of data between your ASP.NET application and the ActiveX components to occur as quickly as possible. Which two actions should you take? (Each correct answer presents part of the solution. Choose two) A. Use ODBC binding. B. Use late binding. C. Use early binding D. Set the AspCompat attribute of the Page directive to true. E. Set the AspCompat attribute of the Page directive to false.
  • Q How To Update Values in a Table with UPDATE Statements?
  • Q How to add a field to a pf and compile it without loss of data?
  • Q Who won Australian Open men's Singles 2015?
  • Q How can you compare hadoop and spark in terms of ease of use?