<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">

<channel>
	<title>Java Interview Questions</title>
	
	<link>http://www.seekjava.info</link>
	<description>J2ee Interview Questions | Core Java Interview Questions | Advanced Java Interview Questions | J2ME Interview Question | JSP interview questions | Servlets interview questions | Jdbc interview questions | Struts interview questions | XML interview questions | Hibernate Interview Questions | Java Patterns Interview Questions | JMS Interview Questions | Java OOPS Interview Questions | EJB Interview Questions | Websphere Interview Questions</description>
	<pubDate>Tue, 09 Sep 2008 16:12:46 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/seekjava" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="seekjava" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Java Interview Questions &amp; Answers</title>
		<link>http://www.seekjava.info/java-interview-questions-answers/</link>
		<comments>http://www.seekjava.info/java-interview-questions-answers/#comments</comments>
		<pubDate>Tue, 09 Sep 2008 16:12:46 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
		
		<category><![CDATA[Java Interview Questions &amp; Answers]]></category>

		<guid isPermaLink="false">http://www.seekjava.info/?p=601</guid>
		<description><![CDATA[1.What is a transient variable?
Ans : A transient variable is a variable that may not be serialized. .
2.Which containers use a border Layout as their default layout?
Ans : The window, Frame and Dialog classes use a border layout as their default layout..
3.Why do threads block on I/O ?
Ans : Threads block on i/o (that is [...]]]></description>
			<content:encoded><![CDATA[<p><strong>1.What is a transient variable?</strong></p>
<p>Ans : A transient variable is a variable that may not be serialized. .</p>
<p><strong>2.Which containers use a border Layout as their default layout?</strong></p>
<p>Ans : The window, Frame and Dialog classes use a border layout as their default layout..</p>
<p><strong>3.Why do threads block on I/O ?</strong></p>
<p>Ans : Threads block on i/o (that is enters the waiting state) so that other threads may execute while the i/o Operation is performed..</p>
<p><strong>4. How are Observer and Observable used ?</strong></p>
<p>Ans : Objects that subclass the Observable class maintain a list of observers. When an Observable object is updated it invokes the update() method of each of its observers to notify the observers that it has changed state. The Observer interface is implemented by objects that observe Observable objects..</p>
<p><strong>5.What is synchronization and why is it important ?</strong></p>
<p>Ans : With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchronization, it is possible for one thread to modify a shared object while another thread is in the process of using or updating that object&#8217;s value.<br />
This often leads to significant errors..</p>
<p><strong>6.Can a lock be acquired on a class ?</strong></p>
<p>Ans : Yes, a lock can be acquired on a class. This lock is acquired on the class&#8217;s Class object&#8230;</p>
<p><strong>7.What&#8217;s new with the stop(), suspend() and resume() methods in JDK 1.2?</strong></p>
<p>Ans : The stop(), suspend() and resume() methods have been deprecated in JDK 1.2..</p>
<p><strong>8.Is null a keyword?</strong></p>
<p>Ans : The null value is not a keyword..</p>
<p><strong>9.What is the preferred size of a component?</strong></p>
<p>Ans : The preferred size of a component is the minimum component size that will allow the component to display normally.</p>
<p><strong>10.What method is used to specify a container&#8217;s layout?</strong></p>
<p>Ans : The setLayout() method is used to specify a container&#8217;s layout</p>
<p><strong>11.Which containers use a FlowLayout as their default layout?</strong></p>
<p>Ans : The Panel and Applet classes use the FlowLayout as their default layout..</p>
<p><strong>12.What state does a thread enter when it terminates its processing?</strong></p>
<p>Ans : When a thread terminates its processing, it enters the dead state..</p>
<p><strong>13.What is the Collections API?</strong></p>
<p>Ans : The Collections API is a set of classes and interfaces that support operations on collections of objects..</p>
<p><strong>14.Which characters may be used as the second character of an identifier, but not as the first character of an identifier?</strong></p>
<p>Ans :The digits 0 through 9 may not be used as the first character of an identifier but they may be used after the first character of an identifier..</p>
<p><strong>15.What is the List interface?</strong></p>
<p>Ans : The List interface provides support for ordered collections of objects..</p>
<p><strong>16.How does Java handle integer overflows and underflows?</strong></p>
<p>Ans :It uses those low order bytes of the result that can fit into the size of the type allowed by the operation..</p>
<p><strong>17.What is the Vector class?</strong></p>
<p>Ans : The Vector class provides the capability to implement a growable array of objects.</p>
<p><strong>18.What modifiers may be used with an inner class that is a member of an outer class?</strong></p>
<p>Ans : A (non-local) inner class may be declared as public, protected, private, static, final, or abstract..</p>
<p><strong>19.What is an Iterator interface?</strong></p>
<p>Ans : The Iterator interface is used to step through the elements of a Collection..</p>
<p><strong>20.What is the difference between the >> and >>> operators?</strong></p>
<p>Ans : The >> operator carries the sign bit when shifting right. The >>> zero-fills bits that have been shifted out..</p>
<p><strong>21.Which method of the Component class is used to set the position and size of a component?</strong></p>
<p>Ans : setBounds().</p>
<p><strong>22.How many bits are used to represent Unicode, ASCII, UTF-16, and UTF-8 characters?</strong></p>
<p>Ans : Unicode requires 16 bits and ASCII require 7 bits. Although the ASCII character set uses only 7 bits, it is usually represented as 8 bits. UTF-8 represents characters using 8, 16, and 18 bit patterns. UTF-16 uses 16-bit and larger bit patterns..</p>
<p><strong>23.What is the difference between yielding and sleeping?</strong></p>
<p>Ans : When a task invokes its yield() method, it returns to the ready state. When a task invokes its sleep() method, it returns to the waiting state..</p>
<p><strong>24.Which java.util classes and interfaces support event handling?</strong></p>
<p>Ans : The EventObject class and the EventListener interface support event processing.</p>
<p><strong>25.Is sizeof a keyword?</strong></p>
<p>Ans : The sizeof operator is not a keyword..</p>
<p><strong>26.What are wrapped classes?</strong></p>
<p>Ans : Wrapped classes are classes that allow primitive types to be accessed as objects..</p>
<p><strong>27.Does garbage collection guarantee that a program will not run out of memory?</strong></p>
<p>Ans : Garbage collection does not guarantee that a program will not run out of memory. It is possible for programs to use up memory resources faster than they are garbage collected.It is also possible for programs to create objects that are not subject to garbage collection.</p>
<p><strong>28.What restrictions are placed on the location of a package statement within a source code file?</strong></p>
<p>Ans : A package statement must appear as the first line in a source code file (excluding blank lines and comments)..</p>
<p><strong>29.Can an object&#8217;s finalize() method be invoked while it is reachable?</strong></p>
<p>Ans : An object&#8217;s finalize() method cannot be invoked by the garbage collector while the object is still reachable. However, an object&#8217;s finalize() method may be invoked by other objects..</p>
<p><strong>30.What is the immediate superclass of the Applet class?</strong></p>
<p>Ans : Panel.</p>
<p><strong>31.What is the difference between preemptive scheduling and time slicing?</strong></p>
<p>Ans : Under preemptive scheduling, the highest priority task executes until it enters the waiting or dead states or a higher priority task comes into existence. Under time slicing, a task executes for a predefined slice of time and then reenters the pool of ready tasks. The scheduler then determines which task should execute next, based on priority and other factors..</p>
<p><strong>32.Name three Component subclasses that support painting.</strong></p>
<p>Ans : The Canvas, Frame, Panel, and Applet classes support painting</p>
<p><strong>33.What value does readLine() return when it has reached the end of a file?</strong></p>
<p>Ans : The readLine() method returns null when it has reached the end of a file..</p>
<p><strong>34.What is the immediate superclass of the Dialog class?</strong></p>
<p>Ans : Window.</p>
<p><strong>35.What is clipping?</strong></p>
<p>Ans : Clipping is the process of confining paint operations to a limited area or shape..</p>
<p><strong>36.What is a native method?</strong></p>
<p>Ans : A native method is a method that is implemented in a language other than Java..</p>
<p><strong>37.Can a for statement loop indefinitely?</strong></p>
<p>Ans :Yes, a for statement can loop indefinitely. For example, consider the following: for(;;) ;.</p>
<p><strong>38.What are order of precedence and associativity, and how are they used?</strong></p>
<p>Ans : Order of precedence determines the order in which operators are evaluated in expressions. Associativity determines whether an expression is evaluated left-to-right or right-to-left.</p>
<p><strong>39.When a thread blocks on I/O, what state does it enter?</strong></p>
<p>Ans : A thread enters the waiting state when it blocks on I/O..</p>
<p><strong>40.To what value is a variable of the String type automatically initialized?</strong></p>
<p>Ans : The default value of an String type is null..</p>
<p><strong>41.What is the catch or declare rule for method declarations?</strong></p>
<p>Ans : If a checked exception may be thrown within the body of a method, the method must either catch the exception or declare it in its throws clause..</p>
<p><strong>42.What is the difference between a MenuItem and a CheckboxMenuItem?</strong></p>
<p>Ans : The CheckboxMenuItem class extends the MenuItem class to support a menu item that may be checked or unchecked..</p>
<p><strong>43.What is a task&#8217;s priority and how is it used in scheduling?</strong></p>
<p>Ans : A task&#8217;s priority is an integer value that identifies the relative order in which it should be executed with respect to other tasks. The scheduler attempts to schedule higher priority tasks before lower priority tasks..</p>
<p><strong>44.What class is the top of the AWT event hierarchy?</strong></p>
<p>Ans :The java.awt.AWTEvent class is the highest-level class in the AWT event-class hierarchy..</p>
<p><strong>45.When a thread is created and started, what is its initial state?</strong></p>
<p>Ans : A thread is in the ready state after it has been created and started..</p>
<p><strong>46.Can an anonymous class be declared as implementing an interface and extending a class?</strong></p>
<p>Ans :An anonymous class may implement an interface or extend a superclass, but may not be declared to do both..</p>
<p><strong>47.What is the range of the short type?</strong></p>
<p>Ans : The range of the short type is -(2^15) to 2^15 - 1..</p>
<p><strong>48.What is the range of the char type?</strong></p>
<p>Ans :The range of the char type is 0 to 2^16 - 1..</p>
<p><strong>49.In which package are most of the AWT events that support the event-delegation model defined?</strong></p>
<p>Ans : Most of the AWT-related events of the event-delegation model are defined in the java.awt.event package. The AWTEvent class is defined in the java.awt package..</p>
<p><strong>50.What is the immediate superclass of Menu?</strong></p>
<p>Ans : MenuItem.</p>
<p><strong>51. What is Synchornize?</strong></p>
<p>Ans: Synchronize is a technique by which a particular block is made accessible only by a single instance at any time. (OR) When two or more objects try to access a resource, the method of letting in one object to access a resource is called sync</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seekjava.info/java-interview-questions-answers/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Advanced enterprise Java Interview Questions</title>
		<link>http://www.seekjava.info/advanced-enterprise-java-interview-questions/</link>
		<comments>http://www.seekjava.info/advanced-enterprise-java-interview-questions/#comments</comments>
		<pubDate>Fri, 04 Apr 2008 20:36:42 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
		
		<category><![CDATA[Advanced Java interview questions]]></category>

		<guid isPermaLink="false">http://www.seekjava.info/advanced-enterprise-java-interview-questions/</guid>
		<description><![CDATA[
1) What is the purpose of garbage collection in Java, and when is it used?
The purpose of garbage collection is to identify and discard objects that are no longer needed by a program so that their resources can be reclaimed and reused. A Java object is subject to garbage collection when it becomes unreachable to [...]]]></description>
			<content:encoded><![CDATA[<p>
1) What is the purpose of garbage collection in Java, and when is it used?</p>
<p>The purpose of garbage collection is to identify and discard objects that are no longer needed by a program so that their resources can be reclaimed and reused. A Java object is subject to garbage collection when it becomes unreachable to the program in which it is used.</p>
<p>2) Describe synchronization in respect to multithreading.</p>
<p>With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchonization, it is possible for one thread to modify a shared variable while another thread is in the process of using or updating same shared variable. This usually leads to significant errors.</p>
<p>></p>
<p>3) How is JavaBeans differ from Enterprise JavaBeans?</p>
<p>The JavaBeans architecture is meant to provide a format for general-purpose components. On the other hand, the Enterprise JavaBeans architecture provides a format for highly specialized business logic components.</p>
<p>4) In what ways do design patterns help build better software?</p>
<p>Design patterns helps software developers to reuse successful designs and architectures. It helps them to choose design alternatives that make a system reusuable and avoid alternatives that compromise reusability through proven techniques as design patterns.</p>
<p>5) Describe 3-Tier Architecture in enterprise application development.</p>
<p>In 3-tier architecture, an application is broken up into 3 separate logical layers, each with a well-defined set of interfaces. The presentation layer typically consists of a graphical user interfaces. The business layer consists of the application or business logic, and the data layer contains the data that is needed for the application.</p>
<p>Source:<br />
http://interviewinfo.net</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seekjava.info/advanced-enterprise-java-interview-questions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>42 Important EJB Interview Question</title>
		<link>http://www.seekjava.info/42-important-ejb-interview-question/</link>
		<comments>http://www.seekjava.info/42-important-ejb-interview-question/#comments</comments>
		<pubDate>Mon, 26 Nov 2007 06:38:04 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
		
		<category><![CDATA[42 Important EJB Interview Question]]></category>

		<guid isPermaLink="false">http://www.seekjava.info/42-important-ejb-interview-question/</guid>
		<description><![CDATA[1. What is EJB
EJB stands for Enterprise JavaBean and is a widely-adopted server side component architecture for J2EE. It enables rapid development of mission-critical application that are versatile, reusable and portable across middleware while protecting IT investment and preventing vendor lock-in.
2. What is session Facade?
Session Facade is a design pattern to access the Entity bean [...]]]></description>
			<content:encoded><![CDATA[<p>1. What is EJB</p>
<p>EJB stands for Enterprise JavaBean and is a widely-adopted server side component architecture for J2EE. It enables rapid development of mission-critical application that are versatile, reusable and portable across middleware while protecting IT investment and preventing vendor lock-in.</p>
<p>2. What is session Facade?</p>
<p>Session Facade is a design pattern to access the Entity bean through local interface than accessing directly. It increases the performance over the network. In this case we call session bean which on turn call entity bean.</p>
<p>3. What is EJB role in J2EE?</p>
<p>EJB technology is the core of J2EE. It enables developers to write reusable and portable server-side business logic for the J2EE platform.</p>
<p>4. What is the difference between EJB and Java beans?</p>
<p>EJB is a specification for J2EE server, not a product; Java beans may be a graphical component in IDE.</p>
<p>5. What are the key features of the EJB technology?</p>
<p>1. EJB components are server-side components written entirely in the Java programming language<br />
2. EJB components contain business logic only - no system-level programming &#038; services, such as transactions, security, life-cycle, threading, persistence, etc. are automatically managed for the EJB component by the EJB server.<br />
3. EJB architecture is inherently transactional, distributed, portable multi-tier, scalable and secure.<br />
4. EJB components are fully portable across any EJB server and any OS.<br />
5. EJB architecture is wire-protocol neutral&#8211;any protocol can be utilized like IIOP,JRMP, HTTP, DCOM,etc.</p>
<p>6. What are the key benefits of the EJB technology?</p>
<p>1. Rapid application development<br />
2. Broad industry adoption<br />
3. Application portability<br />
4. Protection of IT investment</p>
<p>7. How many enterprise beans?</p>
<p>There are three kinds of enterprise beans:<br />
1. session beans,<br />
2. entity beans, and<br />
3. message-driven beans.</p>
<p>8. What is message-driven bean?</p>
<p>A message-driven bean combines features of a session bean and a Java Message Service (JMS) message listener, allowing a business component to receive JMS. A message-driven bean enables asynchronous clients to access the business logic in the EJB tier.</p>
<p>9. What is Entity Bean and Session Bean ?</p>
<p>Entity Bean is a Java class which implements an Enterprise Bean interface and provides the implementation of the business methods. There are two types: Container Managed Persistence(CMP) and Bean-Managed Persistence(BMP).<br />
Session Bean is used to represent a workflow on behalf of a client. There are two types: Stateless and Stateful. Stateless bean is the simplest bean. It doesn&#8217;t maintain any conversational state with clients between method invocations. Stateful bean maintains state between invocations.</p>
<p>10. How EJB Invocation happens?</p>
<p>Retrieve Home Object reference from Naming Service via JNDI. Return Home Object reference to the client. Create me a new EJB Object through Home Object interface. Create EJB Object from the Ejb Object. Return EJB Object reference to the client. Invoke business method using EJB Object reference. Delegate request to Bean (Enterprise Bean).</p>
<p>11. Is it possible to share an HttpSession between a JSP and EJB? What happens when I change a value in the HttpSession from inside an EJB?</p>
<p>You can pass the HttpSession as parameter to an EJB method, only if all objects in session are serializable.This has to be consider as passed-by-value, that means that it’s read-only in the EJB. If anything is altered from inside the EJB, it won’t be reflected back to the HttpSession of the Servlet Container.The pass-by-reference can be used between EJBs Remote Interfaces, as they are remote references. While it is possible to pass an HttpSession as a parameter to an EJB object, it is considered to be bad practice in terms of object-oriented design. This is because you are creating an unnecessary coupling between back-end objects (EJBs) and front-end objects (HttpSession). Create a higher-level of abstraction for your EJBs API. Rather than passing the whole, fat, HttpSession (which carries with it a bunch of http semantics), create a class that acts as a value object (or structure) that holds all the data you need to pass back and forth between front-end/back-end. Consider the case where your EJB needs to support a non HTTP-based client. This higher level of abstraction will be flexible enough to support it.</p>
<p>12. The EJB container implements the EJBHome and EJBObject classes. For every request from a unique client, does the container create a separate instance of the generated EJBHome and EJBObject classes?</p>
<p>The EJB container maintains an instance pool. The container uses these instances for the EJB Home reference irrespective of the client request. while refering the EJB Object classes the container creates a separate instance for each client request. The instance pool maintenance is up to the implementation of the container. If the container provides one, it is available otherwise it is not mandatory for the provider to implement it. Having said that, yes most of the container providers implement the pooling functionality to increase the performance of the application server. The way it is implemented is, again, up to the implementer.</p>
<p>13. Can the primary key in the entity bean be a Java primitive type such as int?</p>
<p>The primary key can’t be a primitive type. Use the primitive wrapper classes, instead. For example, you can use java.lang.Integer as the primary key class, but not int (it has to be a class, not a primitive).</p>
<p>14. Can you control when passivation occurs?</p>
<p>The developer, according to the specification, cannot directly control when passivation occurs. Although for Stateful Session Beans, the container cannot passivate an instance that is inside a transaction. So using transactions can be a a strategy to control passivation. The ejbPassivate() method is called during passivation, so the developer has control over what to do during this exercise and can implement the require optimized logic. Some EJB containers, such as BEA WebLogic, provide the ability to tune the container to minimize passivation calls. Taken from the WebLogic 6.0 DTD -The passivation-strategy can be either default or transaction. With the default setting the container will attempt to keep a working set of beans in the cache. With the transaction setting, the container will passivate the bean after every transaction (or method call for a non-transactional invocation).</p>
<p>15. What is the advantage of using Entity bean for database operations, over directly using JDBC API to do database operations? When would I use one over the other?</p>
<p>Entity Beans actually represents the data in a database. It is not that Entity Beans replaces JDBC API. There are two types of Entity Beans Container Managed and Bean Mananged. In Container Managed Entity Bean - Whenever the instance of the bean is created the container automatically retrieves the data from the DB/Persistance storage and assigns to the object variables in bean for user to manipulate or use them. For this the developer needs to map the fields in the database to the variables in deployment descriptor files (which varies for each vendor). In the Bean Managed Entity Bean - The developer has to specifically make connection, retrive values, assign them to the objects in the ejbLoad() which will be called by the container when it instatiates a bean object. Similarly in the ejbStore() the container saves the object values back the the persistance storage. ejbLoad and ejbStore are callback methods and can be only invoked by the container. Apart from this, when you use Entity beans you dont need to worry about database transaction handling, database connection pooling etc. which are taken care by the ejb container.</p>
<p>16. What is EJB QL?</p>
<p>EJB QL is a Query Language provided for navigation across a network of enterprise beans and dependent objects defined by means of container managed persistence. EJB QL is introduced in the EJB 2.0 specification. The EJB QL query language defines finder methods for entity beans with container managed persistenceand is portable across containers and persistence managers. EJB QL is used for queries of two types of finder methods: Finder methods that are defined in the home interface of an entity bean and which return entity objects. Select methods, which are not exposed to the client, but which are used by the Bean Provider to select persistent values that are maintained by the Persistence Manager or to select entity objects that are related to the entity bean on which the query is defined.</p>
<p>17. Brief description about local interfaces?</p>
<p>EEJB was originally designed around remote invocation using the Java Remote Method Invocation (RMI) mechanism, and later extended to support to standard CORBA transport for these calls using RMI/IIOP. This design allowed for maximum flexibility in developing applications without consideration for the deployment scenario, and was a strong feature in support of a goal of component reuse in J2EE. Many developers are using EJBs locally, that is, some or all of their EJB calls are between beans in a single container. With this feedback in mind, the EJB 2.0 expert group has created a local interface mechanism. The local interface may be defined for a bean during development, to allow streamlined calls to the bean if a caller is in the same container. This does not involve the overhead involved with RMI like marshalling etc. This facility will thus improve the performance of applications in which co-location is planned. Local interfaces also provide the foundation for container-managed relationships among entity beans with container-managed persistence.</p>
<p>18. What are the special design care that must be taken when you work with local interfaces?</p>
<p>It is important to understand that the calling semantics of local interfaces are different from those of remote interfaces. For example, remote interfaces pass parameters using call-by-value semantics, while local interfaces use call-by-reference. This means that in order to use local interfaces safely, application developers need to carefully consider potential deployment scenarios up front, then decide which interfaces can be local and which remote, and finally, develop the application code with these choices in mind. While EJB 2.0 local interfaces are extremely useful in some situations, the long-term costs of these choices, especially when changing requirements and component reuse are taken into account, need to be factored into the design decision.</p>
<p>19. What happens if remove( ) is never invoked on a session bean?</p>
<p>In case of a stateless session bean it may not matter if we call or not as in both cases nothing is done. The number of beans in cache is managed by the container. In case of stateful session bean, the bean may be kept in cache till either the session times out, in which case the bean is removed or when there is a requirement for memory in which case the data is cached and the bean is sent to free pool.</p>
<p>20. What is the difference between Message Driven Beans and Stateless Session beans?</p>
<p>In several ways, the dynamic creation and allocation of message-driven bean instances mimics the behavior of stateless session EJB instances, which exist only for the duration of a particular method call. However, message-driven beans are different from stateless session EJBs (and other types of EJBs) in several significant ways: Message-driven beans process multiple JMS messages asynchronously, rather than processing a serialized sequence of method calls. Message-driven beans have no home or remote interface, and therefore cannot be directly accessed by internal or external clients. Clients interact with message-driven beans only indirectly, by sending a message to a JMS Queue or Topic. Only the container directly interacts with a message-driven bean by creating bean instances and passing JMS messages to those instances as necessary. The Container maintains the entire lifecycle of a message-driven bean; instances cannot be created or removed as a result of client requests or other API calls.</p>
<p>22. How can I call one EJB from inside of another EJB?</p>
<p>EJBs can be clients of other EJBs. It just works. Use JNDI to locate the Home Interface of the other bean, then acquire an instance reference, and so forth.</p>
<p>23. What is an EJB Context?</p>
<p>EJBContext is an interface that is implemented by the container, and it is also a part of the bean-container contract. Entity beans use a subclass of EJBContext called EntityContext. Session beans use a subclass called SessionContext. These EJBContext objects provide the bean class with information about its container, the client using the bean and the bean itself. They also provide other functions. See the API docs and the spec for more details.</p>
<p>24. Is is possible for an EJB client to marshal an object of class java.lang.Class to an EJB?</p>
<p>Technically yes, spec. compliant NO! - The enterprise bean must not attempt to query a class to obtain information about the declared members that are not otherwise accessible to the enterprise bean because of the security rules of the Java language</p>
<p>25. Is it legal to have static initializer blocks in EJB?</p>
<p>Although technically it is legal, static initializer blocks are used to execute some piece of code before executing any constructor or method while instantiating a class. Static initializer blocks are also typically used to initialize static fields - which may be illegal in EJB if they are read/write - In EJB this can be achieved by including the code in either the ejbCreate(), setSessionContext() or setEntityContext() methods.</p>
<p>26. Is it possible to stop the execution of a method before completion in a SessionBean?</p>
<p>Stopping the execution of a method inside a Session Bean is not possible without writing code inside the Session Bean. This is because you are not allowed to access Threads inside an EJB.</p>
<p>27. What is the default transaction attribute for an EJB?</p>
<p>There is no default transaction attribute for an EJB. Section 11.5 of EJB v1.1 spec says that the deployer must specify a value for the transaction attribute for those methods having container managed transaction. In WebLogic, the default transaction attribute for EJB is SUPPORTS.</p>
<p>28. What is the difference between session and entity beans? When should I use one or the other?</p>
<p>An entity bean represents persistent global data from the database; a session bean represents transient user-specific data that will die when the user disconnects (ends his session). Generally, the session beans implement business methods (e.g. Bank.transferFunds) that call entity beans (e.g. Account.deposit, Account.withdraw)</p>
<p>29. Is there any default cache management system with Entity beans ?</p>
<p>In other words whether a cache of the data in database will be maintained in EJB ? - Caching data from a database inside the AAApplication Server are what Entity EJB’s are used for.The ejbLoad() and ejbStore() methods are used to synchronize the Entity Bean state with the persistent storage(database). Transactions also play an important role in this scenario. If data is removed from the database, via an external application - your Entity Bean can still be alive the EJB container. When the transaction commits, ejbStore() is called and the row will not be found, and the transaction rolled back.</p>
<p>30. Why is ejbFindByPrimaryKey mandatory?</p>
<p>An Entity Bean represents persistent data that is stored outside of the EJB Container/Server. The ejbFindByPrimaryKey is a method used to locate and load an Entity Bean into the container, similar to a SELECT statement in SQL. By making this method mandatory, the client programmer can be assured that if they have the primary key of the Entity Bean, then they can retrieve the bean without having to create a new bean each time - which would mean creating duplications of persistent data and break the integrity of EJB.</p>
<p>31. Why do we have a remove method in both EJBHome and EJBObject?</p>
<p>With the EJBHome version of the remove, you are able to delete an entity bean without first instantiating it (you can provide a PrimaryKey object as a parameter to the remove method). The home version only works for entity beans. On the other hand, the Remote interface version works on an entity bean that you have already instantiated. In addition, the remote version also works on session beans (stateless and stateful) to inform the container of your loss of interest in this bean.</p>
<p>32. How can I call one EJB from inside of another EJB?</p>
<p>EJBs can be clients of other EJBs. It just works. Use JNDI to locate the Home Interface of the other bean, then acquire an instance reference, and so forth.</p>
<p>33. What is the difference between a Server, a Container, and a Connector?</p>
<p>An EJB server is an application, usually a product such as BEA WebLogic, that provides (or should provide) for concurrent client connections and manages system resources such as threads, processes, memory, database connections, network connections, etc. An EJB container runs inside (or within) an EJB server, and provides deployed EJB beans with transaction and security management, etc. The EJB container insulates an EJB bean from the specifics of an underlying EJB server by providing a simple, standard API between the EJB bean and its container. A Connector provides the ability for any Enterprise Information System (EIS) to plug into any EJB server which supports the Connector architecture. See Sun’s J2EE Connectors for more in-depth information on Connectors.</p>
<p>34. How is persistence implemented in enterprise beans?</p>
<p>Persistence in EJB is taken care of in two ways, depending on how you implement your beans: container managed persistence (CMP) or bean managed persistence (BMP) For CMP, the EJB container which your beans run under takes care of the persistence of the fields you have declared to be persisted with the database - this declaration is in the deployment descriptor. So, anytime you modify a field in a CMP bean, as soon as the method you have executed is finished, the new data is persisted to the database by the container. For BMP, the EJB bean developer is responsible for defining the persistence routines in the proper places in the bean, for instance, the ejbCreate(), ejbStore(), ejbRemove() methods would be developed by the bean developer to make calls to the database. The container is responsible, in BMP, to call the appropriate method on the bean. So, if the bean is being looked up, when the create() method is called on the Home interface, then the container is responsible for calling the ejbCreate() method in the bean, which should have functionality inside for going to the database and looking up the data.</p>
<p>35. What is an EJB Context?</p>
<p>EJBContext is an interface that is implemented by the container, and it is also a part of the bean-container contract. Entity beans use a subclass of EJBContext called EntityContext. Session beans use a subclass called SessionContext. These EJBContext objects provide the bean class with information about its container, the client using the bean and the bean itself. They also provide other functions. See the API docs and the spec for more details.</p>
<p>36. Is method overloading allowed in EJB?</p>
<p>Yes you can overload methods Should synchronization primitives be used on bean methods? - No. The EJB specification specifically states that the enterprise bean is not allowed to use thread primitives. The container is responsible for managing concurrent access to beans at runtime.</p>
<p>37. Are we allowed to change the transaction isolation property in middle of a transaction?</p>
<p>No. You cannot change the transaction isolation level in the middle of transaction.</p>
<p>38. For Entity Beans, What happens to an instance field not mapped to any persistent storage, when the bean is passivated?</p>
<p>The specification infers that the container never serializes an instance of an Entity bean (unlike stateful session beans). Thus passivation simply involves moving the bean from the ready to the pooled bin. So what happens to the contents of an instance variable is controlled by the programmer. Remember that when an entity bean is passivated the instance gets logically disassociated from it’s remote object. Be careful here, as the functionality of passivation/activation for Stateless Session, Stateful Session and Entity beans is completely different. For entity beans the ejbPassivate method notifies the entity bean that it is being disassociated with a particular entity prior to reuse or for dereference.</p>
<p>39. What is a Message Driven Bean, what functions does a message driven bean have and how do they work in collaboration with JMS?</p>
<p>Message driven beans are the latest addition to the family of component bean types defined by the EJB specification. The original bean types include session beans, which contain business logic and maintain a state associated with client sessions, and entity beans, which map objects to persistent data. Message driven beans will provide asynchrony to EJB based applications by acting as JMS message consumers. A message bean is associated with a JMS topic or queue and receives JMS messages sent by EJB clients or other beans. Unlike entity beans and session beans, message beans do not have home or remote interfaces. Instead, message driven beans are instantiated by the container as required. Like stateless session beans, message beans maintain no client-specific state, allowing the container to optimally manage a pool of message-bean instances. Clients send JMS messages to message beans in exactly the same manner as they would send messages to any other JMS destination. This similarity is a fundamental design goal of the JMS capabilities of the new specification. To receive JMS messages, message driven beans implement the javax.jms.MessageListener interface, which defines a single onMessage() method. When a message arrives, the container ensures that a message bean corresponding to the message topic/queue exists (instantiating it if necessary), and calls its onMessage method passing the client’s message as the single argument. The message bean’s implementation of this method contains the business logic required to process the message. Note that session beans and entity beans are not allowed to function as message beans.</p>
<p>40. Does RMI-IIOP support code downloading for Java objects sent by value across an IIOP connection in the same way as RMI does across a JRMP connection?</p>
<p>Yes. The JDK 1.2 support the dynamic class loading. The EJB container implements the EJBHome and EJBObject classes. For every request from a unique client,</p>
<p>41. Does the container create a separate instance of the generated EJBHome and EJBObject classes?</p>
<p>The EJB container maintains an instance pool. The container uses these instances for the EJB Home reference irrespective of the client request. while refering the EJB Object classes the container creates a separate instance for each client request. The instance pool maintainence is up to the implementation of the container. If the container provides one, it is available otherwise it is not mandatory for the provider to implement it. Having said that, yes most of the container providers implement the pooling functionality to increase the performance of the application server. The way it is implemented is again up to the implementer.</p>
<p>42. What is the advantage of putting an Entity Bean instance from the Ready State to Pooled state</p>
<p>The idea of the Pooled State is to allow a container to maintain a pool of entity beans that has been created, but has not been yet synchronized or assigned to an EJBObject. This mean that the instances do represent entity beans, but they can be used only for serving Home methods (create or findBy), since those methods do not relay on the specific values of the bean. All these instances are, in fact, exactly the same, so, they do not have meaningful state. Jon Thorarinsson has also added: It can be looked at it this way: If no client is using an entity bean of a particular type there is no need for cachig it (the data is persisted in the database). Therefore, in such cases, the container will, after some time, move the entity bean from the Ready State to the Pooled state to save memory. Then, to save additional memory, the container may begin moving entity beans from the Pooled State to the Does Not Exist State, because even though the bean’s cache has been cleared, the bean still takes up some memory just being in the Pooled State.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seekjava.info/42-important-ejb-interview-question/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Java System Design &amp; Analysis Patterns Interview Questions</title>
		<link>http://www.seekjava.info/java-system-design-analysis-patterns-interview-questions/</link>
		<comments>http://www.seekjava.info/java-system-design-analysis-patterns-interview-questions/#comments</comments>
		<pubDate>Sun, 04 Nov 2007 18:59:49 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
		
		<category><![CDATA[Java System Design &amp; Analysis Patterns Interview Qu]]></category>

		<category><![CDATA[Analysis Patterns Interview Questions]]></category>

		<category><![CDATA[Java System Design Interview Questions]]></category>

		<guid isPermaLink="false">http://www.seekjava.info/java-system-design-analysis-patterns-interview-questions/</guid>
		<description><![CDATA[1. What is an analysis pattern?
2. What are the differences between analysis patterns and design patterns?
3. How does &#8220;Extreme Programming&#8221; (XP) fit with patterns?
4. What is the disadvantage of using the Singleton pattern? It is enticing to use this pattern for all the classes as it makes it easy to get the reference of the [...]]]></description>
			<content:encoded><![CDATA[<p>1. What is an analysis pattern?<br />
2. What are the differences between analysis patterns and design patterns?<br />
3. How does &#8220;Extreme Programming&#8221; (XP) fit with patterns?<br />
4. What is the disadvantage of using the Singleton pattern? It is enticing to use this pattern for all the classes as it makes it easy to get the reference of the singleton object.<br />
5. How do you write a Thread-Safe Singleton?<br />
6. What is the Reactor pattern?<br />
7. What are Process Patterns?<br />
8. How and where did the concept of design patterns get started?<br />
9. Where can I find good examples of the Prototype pattern?<br />
10. What are Anti-Patterns?<br />
11. What is a software design pattern?<br />
12. Why is the study of patterns important?<br />
13. How do I document a design pattern?<br />
14. Where can I learn more about design patterns?<br />
15. What is an example of a design pattern?<br />
16. Calendar is an abstract class. The getInstance() method tries to instantiate GregorianCalendar() i.e., parent instantiating a derived class. This looks Non-OO? Ex: Calendar a=Calendar.getInstance(); Can somebody explain why is it so?<br />
17. What major patterns do the Java APIs utilize?<br />
18. How can I make sure at most one instance of my class is ever created?<br />
19. When would I use the delegation pattern instead of inheritance to extend a class&#8217;s behavior?<br />
20. Which patterns were used by Sun in designing the Enterprise JavaBeans model?<br />
21. What patterns are particularly useful in building networked applications?<br />
22. Are there any good Java-specific patterns books available?<br />
23. What are Collaboration Patterns?<br />
24. Is it correct from a design point of view to make an object both an Observer and Observable at the same time?<br />
25. How can I maintain a single instance of an object in an applet?<br />
26. What is the best way to generate a universally unique object ID? Do I need to use an external resource like a file or database, or can I do it all in memory?<br />
27. Is there some kind of Design pattern which would make it possible to use the Same code base in EJB and non EJB context?<br />
28. What is session facade?<br />
29. How is JDO different from VO ?<br />
30. How can I implement the MVC design pattern using JSP?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seekjava.info/java-system-design-analysis-patterns-interview-questions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Struts Interview questions</title>
		<link>http://www.seekjava.info/struts-interview-questions/</link>
		<comments>http://www.seekjava.info/struts-interview-questions/#comments</comments>
		<pubDate>Tue, 02 Oct 2007 16:33:14 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
		
		<category><![CDATA[Struts Interview questions]]></category>

		<category />

		<guid isPermaLink="false">http://www.seekjava.info/struts-interview-questions/</guid>
		<description><![CDATA[Is Struts threadsafe?
Yes
   1. Response is handled by light-weight Action object; rather than individual servlet.
   2. Servlet instantiates Action class once and allows other requests to be threaded through the original object.
   3. This conserves resources and provides best throughput.
What are the various Struts Tag libraries?
Struts provide many tag [...]]]></description>
			<content:encoded><![CDATA[<p>Is Struts threadsafe?</p>
<p>Yes</p>
<p>   1. Response is handled by light-weight Action object; rather than individual servlet.<br />
   2. Servlet instantiates Action class once and allows other requests to be threaded through the original object.<br />
   3. This conserves resources and provides best throughput.</p>
<p>What are the various Struts Tag libraries?</p>
<p>Struts provide many tag libraries to ease the development of web applications. These tag libraries are:</p>
<p>    * Bean tag library - Tags for accessing JavaBeans and their properties.<br />
    * HTML tag library - Tags to output standard HTML, including forms, text boxes, checkboxes, radio buttons etc..<br />
    * Logic tag library - Tags for generating conditional output, iteration capabilities and flow management<br />
    * Tiles or Template tag library - For the application using tiles<br />
    * Nested tag library - For using the nested beans in the application</p>
<p>What is ActionMapping?</p>
<p>   1. Associates an action name with an action.<br />
   2. It can contain reference to a form bean that the action can use.<br />
   3. Defines a list of local forwards that are visible only to this action.</p>
<p>Multiple configuration files in Struts:</p>
<p>Struts can use multiple configuration files. For example:</p>
<p><servlet><br />
<servlet-name>banking</servlet-name><br />
<servlet-class>org.apache.struts.action.ActionServlet<br />
</servlet-class><br />
< init-param ></p>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml,<br />
/WEB-INF/struts-authentication.xml,<br />
/WEB-INF/struts-help.xml<br />
</ param-value ><br />
</ init-param ><br />
<load-on-startup>1</load-on-startup><br />
< / servlet ></p>
]]></content:encoded>
			<wfw:commentRss>http://www.seekjava.info/struts-interview-questions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Websphere Interview Questions</title>
		<link>http://www.seekjava.info/websphere-interview-questions/</link>
		<comments>http://www.seekjava.info/websphere-interview-questions/#comments</comments>
		<pubDate>Tue, 02 Oct 2007 16:28:09 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
		
		<category><![CDATA[Websphere Interview Questions]]></category>

		<guid isPermaLink="false">http://www.seekjava.info/websphere-interview-questions/</guid>
		<description><![CDATA[How to choose websphere over other application servers?
Selecting application server is part of architechtural process when infrastructure is defined. It depends on several facots:
   1. External systems your application will be interacting
   2. Type of application you have
   3. Target availability of system.
   4. Corporate standards
  [...]]]></description>
			<content:encoded><![CDATA[<p>How to choose websphere over other application servers?</p>
<p>Selecting application server is part of architechtural process when infrastructure is defined. It depends on several facots:</p>
<p>   1. External systems your application will be interacting<br />
   2. Type of application you have<br />
   3. Target availability of system.<br />
   4. Corporate standards<br />
   5. Budget.</p>
<p>What are deployment descriptors? How many types of Deployment descriptors are available? What are they?</p>
<p>Deployment descriptor is an XML file that describes how to deploy a module or application by specifying configuration and container options. For example, an EJB deployment descriptor passes information to an EJB container about how to manage and control an enterprise bean. There are two types of deployment descriptor in websphere: Web application deployment descriptor and portlet deployemnt descriptor</p>
<p>Portlets are packaged as WAR files with a web application deployment descriptor (web.xml). This defines each portlet as a servlet within the web application, including unique identifiers for each portlet, the portlet class, and initialization parameters.</p>
<p>How many ways can you deploy applications in websphere?</p>
<p>   1. Directly copy files to deployedapplication folder in websphere- hot deployment.<br />
   2. use websphere specific ant tasks and building automated scripts for deploying application.<br />
   3. through administration console.</p>
<p>What is the difference between web server and application server?</p>
<p>ApplicationServer: takes care of Security, Transaction, Multithreading, Resource pooling, load balancing, clustering, performence, highly availability, scalability, etc. Exposes business logic to client applications through various protocols, possibly including HTTP. Supports deployment of .war and .ear filesApplication server = webserver + EJB container.</p>
<p>Webserver: handles HTTP protocol. Receives HTTP request, it responds with an HTTP response.</p>
<p>How to import jaxp package in IBM WSAD?</p>
<p>   1. open WSAD<br />
   2. go to project<br />
   3. click properties<br />
   4. select javaBuildPath<br />
   5. add any jar file like jaxp select add external jars.</p>
<p>How to implement JDBC-ODBC bridge driver (Type 1) in Websphere?</p>
<p>If you use JDBC type (I) driver you dont need to add any driver in websphere. you simply created DSN and use it locally, same we use java class, if you use Type(2) and Type(4) so first go to admin console then go to connection, then add driver there fill other info like conn. size, uname pass, max conn. and connect it to you applications.</p>
<p>Is there any difference between weblogic and websphere?</p>
<p>Webpshere tends to focus more on integration, connectivity and web services. it has rich implementation of J2EE, better performance, more extensive integration and transaction management. In terms of trnsaction weblogic is having default transaction attribute as ’supports’, but websphere does not have any default transaction attribute.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seekjava.info/websphere-interview-questions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>JSP Interview Questions</title>
		<link>http://www.seekjava.info/jsp-interview-questions/</link>
		<comments>http://www.seekjava.info/jsp-interview-questions/#comments</comments>
		<pubDate>Tue, 02 Oct 2007 16:27:05 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
		
		<category><![CDATA[JSP Interview Questions]]></category>

		<category><![CDATA[JSP interview question]]></category>

		<guid isPermaLink="false">http://www.seekjava.info/jsp-interview-questions/</guid>
		<description><![CDATA[ JSP Action:
    * JSP actions are XML tags that direct the server to use existing components or control the behavior of the JSP engine.
    * Consist of typical (XML-base) prefix of ‘jsp’ followed by a colon, followed by the action name followed by one or more attribute parameters. [...]]]></description>
			<content:encoded><![CDATA[<p> JSP Action:</p>
<p>    * JSP actions are XML tags that direct the server to use existing components or control the behavior of the JSP engine.<br />
    * Consist of typical (XML-base) prefix of ‘jsp’ followed by a colon, followed by the action name followed by one or more attribute parameters. For example: There are six JSP Actions: <jsp:include/>, <jsp:forward/>, <jsp:plugin/>, <jsp:usebean/>, <jsp:setProperty/>, <jsp:getProperty/></p>
<p>What is the difference between <jsp:include page = ... > and<br />
<%@ include file = … >?</p>
<p>Both the tag includes the information from one page in another. The differences are as follows: <jsp:include page = … >: This is like a function call from one jsp to another jsp. It is executed ( the included page is executed and the generated html content is included in the content of calling jsp) each time the client page is accessed by the client. This approach is useful to for modularizing the web application. If the included file changed then the new content will be included in the output.</p>
<p><%@ include file = … >: In this case the content of the included file is textually embedded in the page that have <%@ include file=”..”> directive. In this case in the included file changes, the changed content will not included in the output. This approach is used when the code from one jsp file required to include in multiple jsp files.</p>
<p>What is the difference between <jsp:forward page = ... > and<br />
response.sendRedirect(url) ?</p>
<p>The <jsp:forward> element forwards the request object containing the client request information from one JSP file to another file. The target file can be an HTML file, another JSP file, or a servlet, as long as it is in the same application context as the forwarding JSP file.<br />
sendRedirect sends HTTP temporary redirect response to the browser, and browser creates a new request to go the redirected page. The response.sendRedirect kills the session variables.</p>
<p>Implicit objects available to JSP:</p>
<p>http://www.roseindia.net/interviewquestions/jsp-interview-questions.shtml</p>
<p>Life-cycle methods of JSP:</p>
<p>   1. jspInit(): Container calls jspInit() to initialize the servlet instance. It is called bfore any other method, and is called only once for a servlet instance.<br />
   2. _jspService(): The container calls the _jspservice() for each request and it passes the request and the response objects. This method cannot be overriden.<br />
   3. jspDestroy(): container calls this when its instance is about to be destroyed.</p>
<p>How will you handle runtime exception in your jsp page?</p>
<p>‘errorPage’ attribute of the page directive can be used to catch runtime exceptions automatically and then forwarded to an error processing page. For example: <%@ page errorPae=”dbaccessError.jsp” %> forwards request to dbaccessError.jsp pge if an uncaught exception is encountered during request processing. Within “dbaccessError.jsp”, you must indicate that it is an error processing page, via the directive: <%@ page isErrorPage=”true” %>.</p>
<p>How can you enable session tracking for JSP pages if the browser has disabled cookies: We can enable session tracking using URL rewriting. URL rewriting includes the sessionID within the link itself as a name/value pair. However, for this to be effective, you need to append the session Id for each and every link that is part of your servlet response. adding sessionId to a link is greatly simplified by means of a couple of methods: response.ecnodeURL() associates a session ID with a giver UIRl, and if you are using redirection, response.encodeRedirectURL() can be used by giving the redirected URL as input. Both encodeURL() and encodeRedirectURL() first determine whether cookies are supported by the browser; is so, the input URL is returned unchanged since the session ID wil lbe persisted as cookie.</p>
<p>Which is better fro threadsafe servlets and JSPs? SingleThreadModel Interface or Synchronization? Although the SingleThreadModel technique is easy to use, and works well for low volume sites, it does not scale well. JSps can be made thread safe by having them implement the SingleThreadModel interface. This is done by adding the directive <%@ page isThreadSage=”false” %> withi n your JSP page. With this, instead of a single instance of the servlet generated for your JSP page loaded in memory, you will have N instance of the servlet loaded and initialized, with the service method of each instance effectively synchronized.</p>
<p>How do I prevent the output of my JSP or servlet pages from being caches by the browser?</p>
<p>Set the appropriate HTTP header attributes to prevent the dynamic content output by the JSP page from being cached by the browser. Execute the following scriptlet at the beginning of JSP pages to prevent them from being caches at the browser.</p>
<p><%</p>
<p>response.setHeader(”Cache-Control”,”no-store”); //HTTP 1.1<br />
response.setHeader(”Pragma\”,”no-cache”); //HTTP 1.0<br />
response.setDateHeader (”Expires”, 0); //prevents caching at the proxy server</p>
<p>%></p>
]]></content:encoded>
			<wfw:commentRss>http://www.seekjava.info/jsp-interview-questions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>UML interview questions</title>
		<link>http://www.seekjava.info/uml-interview-questions/</link>
		<comments>http://www.seekjava.info/uml-interview-questions/#comments</comments>
		<pubDate>Tue, 02 Oct 2007 16:24:23 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
		
		<category><![CDATA[UML interview questions]]></category>

		<guid isPermaLink="false">http://www.seekjava.info/uml-interview-questions/</guid>
		<description><![CDATA[What is UML? 
Graphical language for visualizing, specifying, constructing and documenting the artifacts of the system. allows to create blueprints of all the aspects of the system, before physically implementing the system.
What is modeling? What are the advantages of creating a model? 
Well-accepted engineering technique which helps build a model. Model is the simplification of [...]]]></description>
			<content:encoded><![CDATA[<p>What is UML? </p>
<p>Graphical language for visualizing, specifying, constructing and documenting the artifacts of the system. allows to create blueprints of all the aspects of the system, before physically implementing the system.</p>
<p>What is modeling? What are the advantages of creating a model? </p>
<p>Well-accepted engineering technique which helps build a model. Model is the simplification of reality; blueprint of the system that needs to be built. Model helps you visualize the system. helps to specify the structural and behaviour of the sytem. helps make templates for constructing the system. helps document the sytem.</p>
<p>What are the different views considered when building an object-oriented software system? there aer 5 veiws:</p>
<p>   1. Use case view: exposes requirements of a system.<br />
   2. Design view: capturing the vocabulary<br />
   3. process view: modeling the distribution of the sytems processes and threads.<br />
   4. implementation veiw: addressing the physical implementation of the system.<br />
   5. deployement view: focus on the modeling of components required for deploying the system.</p>
<p>What are the major three types of modeling used? </p>
<p>They are 9: Use case diagram, class diagram, object diagram, sequence diagram, statechart diagram, collaboration diagram, activity diagram, component diagram, deployment diagram.</p>
<p>SDLC: Software development life cycle. SDLC of a system includes processes that are Use case driven, architecture centric and iterative and incremental. Life cycle is divided into phases. Phase is a time span between two milestones. The milestones are Inception, Elaboration, construction, and transition. Process workflows that evolve through these phase are Business Modelling, Requirement gathering, Analysis and Design, Implementation, Testing, Deployment. Supporting workflows are configuration and change management, Project management.</p>
<p>What are relationships?</p>
<p>   1. Dependencies: relationship between two entities such that a change in specification of one thing may affect the other. used to show that one class uses another class as an argument in the signature of the operation.<br />
   2. Generalization: relationships specified in the class subclass scenario, it is shown when one entity inherits from other.<br />
   3. Associations: structural relationships. ‘A room has walls’, ‘Person works for a company’.<br />
   4. Aggregation: type of association where there is-a, has-a relationship.</p>
<p>    * Static Diagrams (Structural diagrams): Class diagram, Object diagram, component diagram, deployment diagram.<br />
    * Dynamic diagram(Behavioral diagrams): Use case diagram, sequence diagram, collaboration diagram, activity diagram, statechart diagram.</p>
<p>Messages: Specification of a communication, when a message is passed that results in action that is in turn an executable statement.</p>
<p>Use Case: specifies the behavior of a system or a part of a system. Involves the interaction of actors and system.</p>
<p>Aggregation: One class owns but shares a reference to objects of another class. Child refrerence exists even if parent oject rereference is set to null. Symbol: empty diamond arrow.</p>
<p>Composition: one class contains objects of another class. child reference does not exists independently. Symbol: filled diamond arrow.</p>
<p>Stereotype: Extension to existing UML vocabulary. It is used to create new model elements or derive from existing ones having specific properties pertaining to problem domain. EG: you can create steriotype, <<interface>> derived from existing one, <<class>>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seekjava.info/uml-interview-questions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Servlet Interview Questions</title>
		<link>http://www.seekjava.info/servlet-interview-questions/</link>
		<comments>http://www.seekjava.info/servlet-interview-questions/#comments</comments>
		<pubDate>Tue, 02 Oct 2007 16:21:58 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
		
		<category><![CDATA[Servlet interview questions]]></category>

		<category><![CDATA[Basic Java servlet interview questions]]></category>

		<category><![CDATA[General Java Servlet questions]]></category>

		<guid isPermaLink="false">http://www.seekjava.info/servlet-interview-questions/</guid>
		<description><![CDATA[The java.servlet.Servlet interface defines 3 methos known as life-cycle method.
   1. public void init(ServletConfig config) throws ServletException: servlet is constructe, then initialized with the init() method.
   2. public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException: any request from client are handled initially by the service() method before delegating to the [...]]]></description>
			<content:encoded><![CDATA[<p>The java.servlet.Servlet interface defines 3 methos known as life-cycle method.</p>
<p>   1. public void init(ServletConfig config) throws ServletException: servlet is constructe, then initialized with the init() method.<br />
   2. public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException: any request from client are handled initially by the service() method before delegating to the doXxx() methods in the case of HttpServlet.<br />
   3. public void destroy(): Servlet is removed from service, destroyed with the destroy() method, then garbage collected and finalized.</p>
<p>What is the difference between doGet() and doPost()?</p>
<p>doGet() mthod is limited with 2k of data to be sent, and doPost() mehtod doesn’t have this limitation. A request string for doGet() looks like the following: http://www.google.com/svt1?p1=v1&#038;p2=v2&#038;…&#038;pN=vN. doPost() method call doesntneed a long texttail after a servlet name in a request. All parameters are stored in a request itself, not in a request string, and its impossible to guess the data transmitted to a servlet only looking at the request string.</p>
<p>HttpServlet and GenericServlet: GenericServlet has a service() method aimed to handle requests. HttpServlet extends GenericServlet and addes support for doGet(), doHead() methods (HTTP 1.0) plus doPut(), doOptions(), doDelete(), doTrace() methods. Both these classes are abstract.</p>
<p>ServletContext and ServletConfig: ServletContext defines a set of methods that a servlet uses to communicate with its servlet container, for example, to get the MIME type of a file, dispatch requests, or write to a log file. The ServletContext object is contained within the ServletConfig object, which the web server provides the servlet when the servlet is initialized.</p>
<p>ServletConfig: the object created after a servlet is instantiated and its default constructor is read. It is created to pass initialization infomation to the servlet.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seekjava.info/servlet-interview-questions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Sample Java Interview Questions</title>
		<link>http://www.seekjava.info/sample-java-interview-questions/</link>
		<comments>http://www.seekjava.info/sample-java-interview-questions/#comments</comments>
		<pubDate>Tue, 02 Oct 2007 16:18:56 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
		
		<category><![CDATA[Sample Java Interview Questions]]></category>

		<category><![CDATA[Good questions asked during Java interview]]></category>

		<category><![CDATA[Interview Questions]]></category>

		<category><![CDATA[simple Java questions]]></category>

		<guid isPermaLink="false">http://www.seekjava.info/sample-java-interview-questions/</guid>
		<description><![CDATA[Inheritance: 
Process by which one object acquires the properties of another object. Inheritance allows well-tested procedures to be reused and enables changes to make once and have effect in all relevant places.
Implicit Casting: 
Process of simply assigning one entity to another without any transformation guidance to the compiler.
Native method: method that is not implemented in [...]]]></description>
			<content:encoded><![CDATA[<p>Inheritance: </p>
<p>Process by which one object acquires the properties of another object. Inheritance allows well-tested procedures to be reused and enables changes to make once and have effect in all relevant places.</p>
<p>Implicit Casting: </p>
<p>Process of simply assigning one entity to another without any transformation guidance to the compiler.</p>
<p>Native method: method that is not implemented in java.</p>
<p>Polymorphism: one name many forms. enables one entity to be used as general category for different types of actions.</p>
<p>Encapsulation: process of binding or wrapping the data and the codes that operates on the data into single entity. This keeps data safe from outside interface and misuse. objects allow procedures to be encapsulated with their data to reduce potential interference. one way to think about encapsulation is as a protective wrapper that prevents code and data from being arbitrarily accessed by other code defined outside the wrapper.</p>
<p>Procedural programs: programming logic follows certain procedures and the instructions are executed one after the another. In OOP program, unit of program is object, which is combination of data and code. In procedural program, data is exposed to the whole program whereas in OOPs program, it is accessible with in the object and which in trun assures the security of the code.</p>
<p>What is OOPs? </p>
<p>Object oriented programming organizes a program around its data, ie., objets and a set of welll defined intervaces to that data.</p>
<p>Transient modifier applies to variables only and it is not stored as part or its objects persistent state. Transient variables are not serialized. Volatile modifier applies to variables only and it tells the compiler that the variable modified by volatile can be changed unexpectedly by other parts of the program.</p>
<p>Inner class: classes defined in other classes, including those defined in methods are called inner classes. An inner class can have nay accessibility including private. Anonymous class: class defined inside a mthod without name and is instantiated and declared in the same place and cannot have explicit constructors.</p>
<p>Abstract class: class designed with implementation gaps for subclasses to fill in and is deliberately incomplete. Interface: similar to a class which may contain method’s signature only but no body and it is a formal set of methods and contsant declarations that must be defined by the class that implements it. interfaces are usefull for: declaring methods that one or more classes are expected to implement, capturing similarities between unrelated classes without forcing a class relationship.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seekjava.info/sample-java-interview-questions/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
