More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know.
Ans. The config object is an instantiation of javax.servlet.ServletConfig and is a direct wrapper around the ServletConfig object for the generated servlet. This object allows the JSP programmer access to the Servlet or JSP engine initialization parameters such as the paths or file location.
Help us improve. Please let us know the company, where you were asked this question :
Ans. The pageContext object is an instance of a javax.servlet.jsp.PageContext object. The pageContext object is used to represent the entire JSP page. This object stores references to the request and response objects for each request. The application, config, session, and out objects are derived by accessing attributes of this object.The pageContext object also contains information about the directives issued to the JSP page, including the buffering information, the errorPageURL, and page scope.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Suspend method is used to suspend thread which can be restarted by using resume() method. stop() is used to stop the thread, it cannot be restarted again.
Help us improve. Please let us know the company, where you were asked this question :
LikeDiscussCorrect / Improve  java   threads   multi threading   operating system   synchronization   suspend   stop basic  rare
Q582. What is the difference between System.console.write and System.out.println ?
Ans. System.console() returns null if your application is not run in a terminal (though you can handle this in your application)System.console() provides methods for reading password without echoing charactersSystem.out and System.err use the default platform encoding, while the Console class output methods use the console encoding
Help us improve. Please let us know the company, where you were asked this question :
Q583. Tell something about BufferedWriter ? What are flush() and close() used for ?
Ans. BufferedWriter is temporary source for data storage.BufferedWriter is used to write character data to the file.Flush() is method available in B.W which ensures that all data items are written to file including last character.Close() is used to closes the character output stream.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Scanner class introduced in Java 1.5 for reading Data Stream from the imput device. Previously we used to write code to read a input using DataInputStream. After reading the stream , we can convert into respective data type using in.next() as String ,in.nextInt() as integer, in.nextDouble() as Double etc
Help us improve. Please let us know the company, where you were asked this question :
Ans. When a task invokes yield(), it changes from running state to runnable state. When a task invokes sleep(), it changes from running state to waiting/sleeping state.
Help us improve. Please let us know the company, where you were asked this question :
LikeDiscussCorrect / Improve  java   threads   multi threading   scheduling   thread states   yield   sleeping
Usually asked only to fresh graduates and less experienced developers.
Q587. What is a daemon thread? Give an Example ?
Ans. These are threads that normally run at a low priority and provide a basic service to a program or programs when activity on a machine is reduced. garbage collector thread is daemon thread.
Help us improve. Please let us know the company, where you were asked this question :
What kind of thread is Garbage collection thread ?
Daemon Thread
User Thread
System Thread
Active Thread
Which of following is Daemon Thread ?
Thread Scheduler
Daemon Thread
Both of above
None of above
Q588. What is the difference between AWT and Swing?
Ans. Swing provides both additional components like JTable, JTree etc and added functionality to AWT-replacement components.
Swing components can change their appearance based on the current “look and feel†library that’s being used.
Swing components follow the MVC paradigm, and thus can provide a much more flexible UI.
Swing provides extras for components, such as icons on many components, decorative borders for components, tool tips for components etc.
Swing components are lightweight than AWT.
Swing provides built-in double buffering ,which means an off-screen buffer is used during drawing and then the resulting bits are copied onto the screen.
Swing provides paint debugging support for when you build your own component.
Help us improve. Please let us know the company, where you were asked this question :
LikeDiscussCorrect / Improve  java   awt   java ui   swing   difference between swing and awt   architecture
Q589. What is the order of method invocation in an applet?
Ans. public void init() public void start() public void stop() public void destroy()
Help us improve. Please let us know the company, where you were asked this question :
Ans. LDAP servers are typically used in J2EE applications to authenticate and authorise users. LDAP servers are hierarchical and are optimized for read access, so likely to be faster than database in providing read access.
Help us improve. Please let us know the company, where you were asked this question :
LikeDiscussCorrect / Improve  java   j2ee   ldap   servers   authentication   authorization   architecture   technical lead   technical architect  production support Asked in 1 Companies
Ans. Spring configuration file is an XML file. This file contains the classes information and describes how these classes are configured and introduced to each other.
Help us improve. Please let us know the company, where you were asked this question :
Ans. The Spring container is able to autowire relationships between collaborating beans. This means that it is possible to automatically let Spring resolve collaborators (other beans) for your bean by inspecting the contents of the BeanFactory without using and elements.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Translation of JSP PageCompilation of JSP PageClassloading (class file is loaded by the classloader)Instantiation (Object of the Generated Servlet is created).Initialization ( jspInit() method is invoked by the container).Reqeust processing ( _jspService() method is invoked by the container).Destroy ( jspDestroy() method is invoked by the container).
Help us improve. Please let us know the company, where you were asked this question :