Download Android App in your Android Device from Google Play Store
- Search for "Withoutbook Practice Exam Test" in Mobile/Tablet Play Store
Prepare Interview

Exams Attended

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Core Java Interview Questions and Answers

Ques 81. What are the implicit packages that need not get imported into a class file?

Ans. java.lang

Is it helpful? Add Comment View Comments
Ques 82. What is the difference between lightweight and heavyweight component?
Ans. Lightweight components reuses its parents graphical units. Heavyweight components goes with the native graphical unit for every component. Lightweight components are faster than the heavyweight components.
Is it helpful? Add Comment View Comments
Ques 83. What are the ways in which you can instantiate a thread?
Ans. Using Thread class By implementing the Runnable interface and giving that handle to the Thread class.
class RunnableThread implements Runnable {
	Thread runner;
	
	public RunnableThread() {
	}
	
	public RunnableThread(String threadName) {
		runner = new Thread(this, threadName); // (1) Create a new thread.
		System.out.println(runner.getName());
		runner.start(); // (2) Start the thread.
	}

	public void run() {
		//Display info about this particular thread
		System.out.println(Thread.currentThread());
	}
}
Is it helpful? Add Comment View Comments
Ques 84. What are the states of a thread?
Ans. A thread state. A thread can be in one of the following states:

A thread can be in only one state at a given point in time. These states are virtual machine states which do not reflect any operating system thread states.

Is it helpful? Add Comment View Comments
Ques 85. What is a socket?
Ans. A socket is an endpoint for communication between two machines.
Is it helpful? Add Comment View Comments

Most helpful rated by users:

©2020 WithoutBook