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 :
1Two types of MultiTasking :
-> multithreading and multiprocessing.
1About 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.
->Process are heavy weight.
->Each process have their separate memory area.
->Switching between 2 process takes time.
1Creation of Thread:
->Thread can be created by extending Thread class or implementing runnable interface.
->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.
1About 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.
->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.
->methods of object class->notify(),notifyall(),wait().
->methods of thread class->run(),start()
->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.
->run() method should be overridden by a class which implements runnable interface.
->run() method contain body of thread
->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.
-> 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().
->notify() will awake a single thread which is waiting for a monitor.
->notifyAll() will awake all threads which are waiting for monitor.
1what 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.
->Once a thread is dead it can not be restarted.
->stop() is used to kill a thread at any stage.
->sleep() throws InteruptedException.
If you want some more point to be added then you can comment down below or can mail us at our mail-id firstname.lastname@example.org or email@example.com.