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 Permanent Generation (PermGen) space has completely been removed and is kind of replaced by a new space called Metaspace. The consequences of the PermGen removal is that obviously the PermSize and MaxPermSize JVM arguments are ignored and you will never get a java.lang.OutOfMemoryError: PermGen error.
Help us improve. Please let us know the company, where you were asked this question :
Ans. substring method would build a new String object keeping a reference to the whole char array, to avoid copying it. Hence you can inadvertently keep a reference to a very big character array with just a one character string.
Help us improve. Please let us know the company, where you were asked this question :
Ans. 1. No need to know SQL, RDBMS, and DB Schema. 2. Underlying Database can be changed without much effort by changing SQL dialect and DB connection. 3.Improved Performance by means of Caching.
Help us improve. Please let us know the company, where you were asked this question :
Ans. 1. It shouldn't result in infinite loop. Please make sure that you have a condition that will terminate the loop and that condition should be reached.
2. Make sure to use the break statement if you aspire to only look for something. Not using break will unnecessarily execute it till the end of for loop in some cases.
3. Similarly use continue to execute the loop with next iteration and bypass the rest of the code block if required.
4. Try to avoid multiple nesting of for loops. If it''s required, Make sure to use break and continue properly so as to avoid some unnecessary processing.
5. Make sure to use try catch within the loop and not outside the for loop if you expect it to continue if one of the iteration fails.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Suppose we want to visit a site for any information, information can be represented in different languages like English,German or may be other and their format for presentation can also differ from HTML to PDF or may be Plain text. In this case when an client makes an HTTP request to a server, client can also specify the media types here. Client can specify what it can accept back from host and on the basis of availability the host will return to the client. This is called content negotiation because client and server negotiated on the language and format of the content to be shared.
Help us improve. Please let us know the company, where you were asked this question :
Q37. 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
Q38. Name few tools for probing Java Memory Leaks ?
Ans. JProbe, OptimizeIt
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. In GUI programming, an object that can be registered to be notified when events of some given type occur. The object is said to listener? for the events.
Help us improve. Please let us know the company, where you were asked this question :
Ans. A way of encoding characters as binary numbers. The Unicode character set includes characters used in many languages, not just English. Unicode is the character set that is used internally by Java.
Help us improve. Please let us know the company, where you were asked this question :
Ans. It's a technique to allow multiple clients to make use of a cached set of shared and reusable connection objects providing access to a database or other resource.
Help us improve. Please let us know the company, where you were asked this question :
Ans. It refers to writing programs that execute across multiple devices (computers), in which the devices are all connected to each other using a network.
Help us improve. Please let us know the company, where you were asked this question :
Q45. What are the advantages and Disadvantages of Sockets ?
Ans. Sockets are flexible and sufficient. Efficient socket based programming can be easily implemented for general communications. It cause low network traffic.
Socket based communications allows only to send packets of raw data between applications. Both the client-side and server-side have to provide mechanisms to make the data useful in any way.
Help us improve. Please let us know the company, where you were asked this question :
Ans. The best practice guideline between settings.xml and pom.xml is that configurations in settings.xml must be specific to the current user and that pom.xml configurations are specific to the project.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Yes and No. JVM is an extra layer that translates Byte Code into Machine Code. So Comparing to languages like C, Java provides an additional layer of translating the Source Code.
Though it looks like an overhead but this additional translation allows Java to run Apps on all platforms as JVM provides the translation to the Machine code as per the underlying Operating System.
Help us improve. Please let us know the company, where you were asked this question :
Ans. With the advent of Internet, HTTP is the most preferred way of communication. Most of the clients ( web thin client , web thick clients , mobile apps ) are designed to communicate using http only. Web Services using http makes them accessible from vast variety of client applications.
Help us improve. Please let us know the company, where you were asked this question :
Ans. http protocol on its own is stateless. So it helps in identifying the relationship between multiple stateless request as they come from a single source.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Session info in the request can be intercepted and hence a vulnerability. Cookie can be read and write by respective domain only and make sure that right session information is being passed by the client.
Help us improve. Please let us know the company, where you were asked this question :
LikeDiscussCorrect / Improve  j2ee   servlets   session   session management   web applications   cookies   httpsession   architecture
Ans. Lazy fetching is the technique of not loading the child objects when parent objects are loaded. By default Hibernate does not load child objects. One can specify whether to load them or not while doing the association.
Help us improve. Please let us know the company, where you were asked this question :