Java MCQ quiz summary on MultiThreading.

What is Java MCQ quiz summary?

Java  MCQ quiz summary consist of all points and notes which may be asked in a technical aptitude round of most of the  interview. In this post you will get all the short and simple key point which are generally asked in most of the exam. We have covered in depth knowledge of  all topic in java.

Why Java MCQ quiz summary?

Generally we have seen like if a student want to prepare for MCQ quiz then they will wander a lot of website and also they won’t get a proper material to study. In many website we have seen like they provide MCQ and then their option . In this a lot of time is get wasted as a person have to first read the question then think on the question and then will see the option and after that checking the right answer whether it is right or wrong.So this process waste a lot of time of student and he/she is able to read only 9 to 10 MCQ. So to avoid this we came with MCQ quiz summary idea.This will not only help the student preparing fast but also it will saves a lot of amount of time.

 

Who Should read this MCQ quiz summary?

  • -> The people who have some prior knowledge about the concept of Multithreading.
  • -> This MCQ quiz summary will help all the people who want to go through all the concept briefly.
  • -> This are also helpful for people, who are preparing for interview including both freshers and experience.
  • -> This is also helpful for people who want to prepare for MCQ exam in small time.

 

 MCQ quiz Summary on Multithreading :

  1. Two types of MultiTasking :

    -> multithreading and multiprocessing.

  2. About Multithreading :

    ->Executing 2 or more thread simultaneously is called as Multithreading.
    ->Thread share common memory area.
    ->Threads are Lightweight Process and switching between 2 thread is fast
    ->Thread have their own stack(When run method() is called and not when start() method is called.
    ->Thread requires less resources.

  3. About Multiprocessing:

    ->Process are heavy weight.
    ->Each process have their separate memory area.
    ->Switching between 2 process takes time.

  4. Creation of Thread:

    ->Thread can be created by extending Thread class or implementing runnable interface.

  5. Main Thread:

    ->all java program has atleast one thread which is main thread.
    ->When any java program start first main thread starts.
    ->It is the last thread to finish execution beacuse it have to perform shutdown process.
    ->default priority of main thread is 5.
    ->All the thread which are inherited from parent thread have the same priority which the parent thread have.
    ->In this case as a main thread have default priority of 5 so all thread which inherited from main thread have default priority of 5 only.

  6. About Daemon Thread:

    ->its a low priority thread.
    ->Its life depends on user thread.
    ->It provides services to user thread for background supporting tasks.
    ->It prevent JVM from terminating.
    ->child thread of daemon thread is also a Daemon thread.

  7. start():

    ->start() method is used to start the thread execution.
    ->It calls a run() method.
    ->start() method is used to register a thread in thread registers.

  8. methods:

    ->methods of object class->notify(),notifyall(),wait().
    ->methods of thread class->run(),start()

  9. wait():

    ->wait() causes a thread to directly wait (stop) the execution until other thread call notify() or notifyall().
    ->wait() will keep the thread in running state.

  10. run():

    ->run() method should be overridden by a class which implements runnable interface.
    ->run() method contain body of thread

  11. priority:

    ->Thread priority are assigned in integer.
    ->Thread scheduler determines the priority of thread and again it dependent on OS.
    ->Highest priority of a thread can be 10 and minimum can be 1.
    ->When 2 or more thread of same priotiy comes for execution at a same time then to process which thread first depends on operating system.
    ->NORM_PRIORITY is used to set default priority.

  12. polling:

    -> polling(polling means the CPU time is wasted while waiting for the incoming data and checking it again and again) is avoided in java by using wait(),notify(),notifyall().

  13. notify():

    ->notify() will awake a single thread which is waiting for a monitor.

  14. notifyAll():

    ->notifyAll() will awake all threads which are waiting for monitor.

  15. what is Synchronization:

    ->Synchronization means when 2 or more thread want to access same data or resource then some mechanism is needed to ensure that at a one time only one thread is accessing
    the data or resource.

  16. others:

    ->Once a thread is dead it can not be restarted.
    ->stop() is used to kill a thread at any stage.
    ->sleep() throws InteruptedException.

 

Note:

If you want some more point to be added then you can comment down below or can mail us at our mail-id [email protected] or [email protected].

Thank You!