This section includes 7 InterviewSolutions, each offering curated multiple-choice questions to sharpen your Current Affairs knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
What Is Clustering? What Are The Different Algorithms Used For Clustering? |
|
Answer» CLUSTERING is GROUPING MACHINES together to transparently provide enterprise services. The client does not know the difference between approaching one server or approaching a CLUSTER of servers. Clusters provide two benefits: scalability and HIGH availability. Clustering is grouping machines together to transparently provide enterprise services. The client does not know the difference between approaching one server or approaching a cluster of servers. Clusters provide two benefits: scalability and high availability. |
|
| 2. |
How Does Ejb Invocation Happens? |
|
Answer» 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). 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). |
|
| 3. |
What Are The Applet's Information Methods? |
|
Answer» The following are the APPLET's information methods:
The following are the Applet's information methods: |
|
| 4. |
Which Classes And Interfaces Does Applet Class Consist? |
|
Answer» APPLET CLASS consists of a single class, the Applet class and THREE INTERFACES: AppletContext, AppletStub and AudioClip. Applet class consists of a single class, the Applet class and three interfaces: AppletContext, AppletStub and AudioClip. |
|
| 5. |
What Are The Applet's Life Cycle Methods? Explain Them. |
|
Answer» FOLLOWING are the METHODS in the life cycle of an Applet: Following are the methods in the life cycle of an Applet: |
|
| 6. |
What Is Chat Area? Explain. |
|
Answer» Ever since the first computers were connected, people have been using them to talk. A chat AREA is an interface that lets a group of people talk by typing messages. Like all INTERNET-based program, chat programs must follow a specific protocol: Specifically, chat programs rely on the Internet Relay Chat (IRC) protocol. However, chatting on a Web page has been ad-hoc at best, until Java. Ever since the first computers were connected, people have been using them to talk. A chat area is an interface that lets a group of people talk by typing messages. Like all Internet-based program, chat programs must follow a specific protocol: Specifically, chat programs rely on the Internet Relay Chat (IRC) protocol. However, chatting on a Web page has been ad-hoc at best, until Java. |
|
| 7. |
Why A Client Should Be Multithreading? Explain. |
|
Answer» In many types of client applications, support for multiple threads is ALSO useful. A Web browser, for example, is a multithreaded application. Within a browser, you can have multiple windows open and perform multiple downloads at the same time. To perform each download operation, the browser simply starts a NEW thread which preforms the CORRESPONDING processing. In many types of client applications, support for multiple threads is also useful. A Web browser, for example, is a multithreaded application. Within a browser, you can have multiple windows open and perform multiple downloads at the same time. To perform each download operation, the browser simply starts a new thread which preforms the corresponding processing. |
|
| 8. |
Why Servers Should Be Multithreading? Explain. |
|
Answer» As you know, multithreading lets your Java PROGRAM PERFORM tasks in PARALLEL. A server is a great example of a program that should be multithreaded. If a server has a single thread of control, only one client can INTERACT with the server at any one time. If you write your server to support multithreading, the server can PROCESS many client-server connections simultaneously. As you know, multithreading lets your Java program perform tasks in parallel. A server is a great example of a program that should be multithreaded. If a server has a single thread of control, only one client can interact with the server at any one time. If you write your server to support multithreading, the server can process many client-server connections simultaneously. |
|
| 9. |
What Is The Applet Client Restriction? |
|
Answer» Java places restrictions on an APPLET. One restriction is that an applet cannot make a SOCKET connection to any server other than the one it came from (the server from which the browser downloaded the applet). Therefore, you cannot, for example, make a generic MAIL TOOL applet unless you plan to support it with SMTP and POP3 mail servers on the same machine that stores the applet. Also, because of this restriction, you cannot have two applets connect directly together, so that two users can play a game. Consequently, you should always take applet restrictions into consideration when you design a Java-server application with applets. Java places restrictions on an applet. One restriction is that an applet cannot make a Socket connection to any server other than the one it came from (the server from which the browser downloaded the applet). Therefore, you cannot, for example, make a generic mail tool applet unless you plan to support it with SMTP and POP3 mail servers on the same machine that stores the applet. Also, because of this restriction, you cannot have two applets connect directly together, so that two users can play a game. Consequently, you should always take applet restrictions into consideration when you design a Java-server application with applets. |
|
| 10. |
What Is The Relationship Between Servers And Ports? |
|
Answer» As you have learned, an IP address identifies a computer on the Internet. You also learned that a port number identifies a process (a PROGRAM) that is running on a computer. As it TURNS out, programs use port numbers for client and server APPLICATIONS. Because IP addresses are unique and on a given computer, port numbers are unique, a port number combined with an IP address completely distinguishes an application running on the Internet. The combination of port number and IP address yields a socket and provides an END point of a communication path. As you will learn the same application IP address and port number may use multiple sockets, each having a different value. Thus, a socket's value combines an application-specific value with the IP address and port number. As you have learned, an IP address identifies a computer on the Internet. You also learned that a port number identifies a process (a program) that is running on a computer. As it turns out, programs use port numbers for client and server applications. Because IP addresses are unique and on a given computer, port numbers are unique, a port number combined with an IP address completely distinguishes an application running on the Internet. The combination of port number and IP address yields a socket and provides an end point of a communication path. As you will learn the same application IP address and port number may use multiple sockets, each having a different value. Thus, a socket's value combines an application-specific value with the IP address and port number. |
|
| 11. |
What Are Protocols? What Are They Used For? |
|
Answer» To write a client-server application, you must create two programs: the client and the server. Within these programs, you must define how the two applications will communicate—the rules each program must follow. As you have learned, the rules the client and server program must follow to communicate are protocols. In short, protocols define how client-server programs interact. To write a client-server application, you must create two programs: the client and the server. Within these programs, you must define how the two applications will communicate—the rules each program must follow. As you have learned, the rules the client and server program must follow to communicate are protocols. In short, protocols define how client-server programs interact. |
|
| 12. |
What Do You Understand By The Term Client-server Application? |
|
Answer» NETWORKS make many new types of applications possible because a SINGLE machine no longer has to do everything. Within a network, some computers, called servers, perform specialized tasks on behalf of other programs. A program that uses a server is a client. Networks make many new types of applications possible because a single machine no longer has to do everything. Within a network, some computers, called servers, perform specialized tasks on behalf of other programs. A program that uses a server is a client. |
|
| 13. |
What Does Tcp/ip Stand For And What Is Its Use? |
|
Answer» To communicate across the Internet, a program must follow a specific set of RULES, called protocols. These protocols may specify the SIZE and format of the program's ELECTRONIC messages or how programs synchronize messages. In short, who sends the first message and what type of REPLY the sender expects. To communicate across the Internet, a program must follow a specific set of rules, called protocols. These protocols may specify the size and format of the program's electronic messages or how programs synchronize messages. In short, who sends the first message and what type of reply the sender expects. |
|
| 14. |
Explain The Generic Term Internet. |
|
Answer» The generic TERM internet refers to a network of networks. The Internet is just one particular internet. However, it is the ultimate network of networks. Because you are interested in Java, you have certainly used a Web browser to SURF the Internet. As you probably know, a Web browser is only one of many Internet applications. The generic term internet refers to a network of networks. The Internet is just one particular internet. However, it is the ultimate network of networks. Because you are interested in Java, you have certainly used a Web browser to surf the Internet. As you probably know, a Web browser is only one of many Internet applications. |
|
| 15. |
What Do You Understand By The Term Network? |
|
Answer» A network is a set of computers and peripherals, such as modems and printers, that are physically connected together. A particular network has a unique set of HARDWARE and software that enables various computers and peripherals to communicate. The POWER of networks enables computers to share resources. For example, a small computer on a network can access and use other computers that are much more POWERFUL. A network is a set of computers and peripherals, such as modems and printers, that are physically connected together. A particular network has a unique set of hardware and software that enables various computers and peripherals to communicate. The power of networks enables computers to share resources. For example, a small computer on a network can access and use other computers that are much more powerful. |
|
| 16. |
Is It Possible To Stop The Execution Of A Method Before Completion In A Sessionbean? |
|
Answer» 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. 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. |
|
| 17. |
What Is The Default Transaction Attribute For An Ejb? |
|
Answer» There is no default TRANSACTION attribute for an EJB. In WEBLOGIC, the default transaction attribute for EJB is SUPPORTS. There is no default transaction attribute for an EJB. In weblogic, the default transaction attribute for EJB is SUPPORTS. |
|
| 18. |
Is Method Overloading Allowed In Ejb? |
|
Answer» Yes you can overload methods |
|
| 19. |
Should Synchronization Primitives Be Used On Bean Methods? |
|
Answer» 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 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 |
|
| 20. |
Are We Allowed To Change The Transaction Isolation Property In Middle Of A Transaction? |
|
Answer» No. You cannot CHANGE the TRANSACTION ISOLATION LEVEL in the MIDDLE of transaction. No. You cannot change the transaction isolation level in the middle of transaction. |
|
| 21. |
How May Messaging Models Do Jms Provide For And What Are They? |
|
Answer» JMS PROVIDE for TWO MESSAGING models, publish-and subscribe and point-to-point queuing. JMS provide for two messaging models, publish-and subscribe and point-to-point queuing. |
|
| 22. |
Why Ruby On Rails? |
|
Answer» There are LOT of advantages of using ruby on rails There are lot of advantages of using ruby on rails |
|
| 23. |
What Is Rails? |
|
Answer» ► Ruby on RAILS is an open source web application framework for the Ruby programming LANGUAGE. ► Ruby on Rails is an open source web application framework for the Ruby programming language. |
|
| 24. |
Describe Class Libraries In Ruby? |
|
Answer» ► The RUBY standard library extends the foundation of the Ruby built-in library with classes and abstractions for a variety of programming needs, including network programming, operating system services, threads, and more. ► The Ruby standard library extends the foundation of the Ruby built-in library with classes and abstractions for a variety of programming needs, including network programming, operating system services, threads, and more. |
|
| 25. |
Explain The Concepts And Capabilities Of Garbage Collection Feature Of Ruby? |
|
Answer» ► Ruby is an object oriented language and every object oriented language TENDS to ALLOCATE many OBJECTS during EXECUTION of the program. ► Ruby is an object oriented language and every object oriented language tends to allocate many objects during execution of the program. |
|
| 26. |
Describe The Environment Variables Present In Ruby. |
|
Answer» RUBYOPT RUBYLIB RUBYPATH RUBYSHELL RUBYLIB_PREFIX RUBYOPT RUBYLIB RUBYPATH RUBYSHELL RUBYLIB_PREFIX |
|
| 27. |
Interpolation Is A Very Important Process In Ruby, Comment? |
|
Answer» ► Interpolation is the PROCESS of INSERTING a STRING into a literal. ► Interpolation is the process of inserting a string into a literal. |
|
| 28. |
What Is The Use Of Super In Ruby Rails? |
|
Answer» ► Ruby uses the super keyword to call the SUPERCLASS implementation of the current method. ► Ruby uses the super keyword to call the superclass implementation of the current method. |
|
| 29. |
Explain The Use Of Global Variable $ In Ruby? |
|
Answer» If you DECLARE one VARIABLE as global we can ACCESS any where, where as class variable visibility only in the class. If you declare one variable as global we can access any where, where as class variable visibility only in the class. |
|
| 30. |
Explain The Difference Between Nil And False In Ruby? |
|
Answer» FALSE is a BOOLEAN datatype False is a boolean datatype |
|
| 31. |
What Optimization Could I Use If The Ejb Container Is The Only Point Of Write Access To The Database ? |
|
Answer» You COULD ACTIVATE the "Commit Option A" that is the container caches entity BEAN state between transactions. This option assumesthat the container has exclusive ACCESS to the persistentstore and therefore it doesn’t need to synchronizethe in-memory bean state from the persistent store at the BEGINNING of each transaction. You could activate the "Commit Option A" that is the container caches entity bean state between transactions. This option assumesthat the container has exclusive access to the persistentstore and therefore it doesn’t need to synchronizethe in-memory bean state from the persistent store at the beginning of each transaction. |
|
| 32. |
What Do You Need To Set-up A Cluster With Jboss ? |
|
Answer» BASICALLY STARTING JBOSS with the “all” CONFIGURATION contains everything needed for clustering: It has all the libraries for clustering: Basically starting JBoss with the “all” configuration contains everything needed for clustering: It has all the libraries for clustering: |
|
| 33. |
What Is The Diffrence Between A Local-tx-datasource And A Xa-datasource? Can You Use Transactions In Both ? |
|
Answer» A LOCAL-tx-datasource identifies a data SOURCE that uses transactions, even distributed trans ACTIONS within the local application server, but doesn’t use distributed transactions among multiple application SERVERS. An xa-datasource on the other HAND identifies a data source that uses distributed transaction among multi-ple application servers. A local-tx-datasource identifies a data source that uses transactions, even distributed trans actions within the local application server, but doesn’t use distributed transactions among multiple application servers. An xa-datasource on the other hand identifies a data source that uses distributed transaction among multi-ple application servers. |
|
| 34. |
What Are The Differences Between Ejb 3.0 And Ejb 2.0 ? |
|
Answer» EJBS are now plain old Java objects (POJO) that expose REGULAR business interfaces (POJI), and there is no requirement for home interfaces.
EJBs are now plain old Java objects (POJO) that expose regular business interfaces (POJI), and there is no requirement for home interfaces. |
|
| 35. |
What If You Need To Span Your Transaction Across Multiple Servlet Invocations ? |
|
Answer» You can't with a Servlet. A JTA transaction must start and FINISH within a single invocation (of the service() METHOD). You should consider using a STATEFUL SB. In a SFSB with a JTA transaction, the ASSOCIATION between the bean instance and the transaction is retained across multiple client calls. You can't with a Servlet. A JTA transaction must start and finish within a single invocation (of the service() method). You should consider using a Stateful SB. In a SFSB with a JTA transaction, the association between the bean instance and the transaction is retained across multiple client calls. |
|
| 36. |
Ok, Is The Session Factory Thread Safe? |
|
Answer» YES: that is many threads can access it cuncurrentely and request for sessions. It holds cached data that has been read in one UNIT of work and may be REUSED in a future unit of work. Good PRACTICE is to create it when the application is initialized. Yes: that is many threads can access it cuncurrentely and request for sessions. It holds cached data that has been read in one unit of work and may be reused in a future unit of work. Good practice is to create it when the application is initialized. |
|
| 37. |
Which Hibernate Object Wraps The Jdbc Connection ? |
|
Answer» The Session interface wraps a JDBC CONNECTION. This interface is a single threaded object which REPRESENTS a single UNIT of work with application and PERSISTENT database. It's retrieved by the SessionFactory's open Session() method. The Session interface wraps a JDBC Connection. This interface is a single threaded object which represents a single unit of work with application and persistent database. It's retrieved by the SessionFactory's open Session() method. |
|
| 38. |
What's The Difference Between Hibernate And Ejb 3 ? Don't You Think Ejb 3 Is Just A Clone Of Hibernate ? |
|
Answer» The perception of EJB3 as being a simple clone of Hibernate is primarily based on DEVELOPER familiarity with Hibernate and a similarity of naming, as well as common purpose, and that Hibernate is morphing itself into an EJB3 implementation based on the work going into the specification, not the other way around. EJBs are supposed to be components, in the SENSE that they're not just one class, but a set of classes, descriptors and usage and management contracts. All of this in order to allow a container (JBOSS, Weblogic, etc.) to provide services to those components, and to be able to reuse and distribute this components. This services are, among others, transactions, concurrent access CONTROL, security, instance pooling, etcetera. Hibernat is "just" an ORM (Object/Relational Mapping) tool. Quick and dirty, this means you can store an object tree belonging to an class hierarchy in a relational DB WITHOUT writing a single SQL query. Quite cool, IMO. But no transaction control, no instance pooling, no concurrency control, and certainly no security. The perception of EJB3 as being a simple clone of Hibernate is primarily based on developer familiarity with Hibernate and a similarity of naming, as well as common purpose, and that Hibernate is morphing itself into an EJB3 implementation based on the work going into the specification, not the other way around. EJBs are supposed to be components, in the sense that they're not just one class, but a set of classes, descriptors and usage and management contracts. All of this in order to allow a container (JBoss, Weblogic, etc.) to provide services to those components, and to be able to reuse and distribute this components. This services are, among others, transactions, concurrent access control, security, instance pooling, etcetera. Hibernat is "just" an ORM (Object/Relational Mapping) tool. Quick and dirty, this means you can store an object tree belonging to an class hierarchy in a relational DB without writing a single SQL query. Quite cool, IMO. But no transaction control, no instance pooling, no concurrency control, and certainly no security. |
|
| 39. |
Can I Unit Test Seam Applications Without Starting The Application Server? |
|
Answer» Yes, Seam PROVIDES its own integration TEST framework based on TestNG You can easily mock all Seam SERVICES using those facilities without ever loading an APPLICATION SERVER or a database. Yes, Seam provides its own integration test framework based on TestNG You can easily mock all Seam services using those facilities without ever loading an application server or a database. |
|
| 40. |
Can I Use Ajax With Seam? |
|
Answer» Yes, SEAM provides excellent support for AJAX. First, Seam supports the ICEfaces and Ajax4JSF Ajax component libraries for JSF. If you prefer a more "old fashioned" approach, Seam provides a complete JavaScript remoting framework which lets you call Seam components and SUBSCRIBE to JMS topics directly from the client. Please refer to the Seam remoting example application on how to use AJAX remoting to implement a chat room. Yes, Seam provides excellent support for AJAX. First, Seam supports the ICEfaces and Ajax4JSF Ajax component libraries for JSF. If you prefer a more "old fashioned" approach, Seam provides a complete JavaScript remoting framework which lets you call Seam components and subscribe to JMS topics directly from the client. Please refer to the Seam remoting example application on how to use AJAX remoting to implement a chat room. |
|
| 41. |
Are There Books About Seam? |
|
Answer» Yes, PRENTICE Hall's "JBoss Seam: SIMPLICITY and Power Beyond Java EE 5.0" is a comprehensive guide for Seam WRITTEN by JBoss insiders. Yes, Prentice Hall's "JBoss Seam: Simplicity and Power Beyond Java EE 5.0" is a comprehensive guide for Seam written by JBoss insiders. |
|
| 42. |
Where Can I Ask Questions And Make Suggestions About Seam? |
|
Answer» Please USE the SEAM User's discussion forum for user questions. Please use the Seam User's discussion forum for user questions. |
|
| 43. |
Where Can I Find Seam Examples And Documentation? |
|
Answer» The source code and build script of all Seam example APPLICATIONS are included in the examples directory of theSeam distribution. Seam DOCUMENTATION is AVAILABLE here. The source code and build script of all Seam example applications are included in the examples directory of theSeam distribution. Seam documentation is available here. |
|
| 44. |
Can I Run Seam With Jdk 1.4 And Earlier? |
|
Answer» No, SEAM only WORKS on JDK 5.0 and above. It uses ANNOTATIONS and other JDK 5.0 FEATURES. No, Seam only works on JDK 5.0 and above. It uses annotations and other JDK 5.0 features. |
|
| 45. |
Can I Run Seam In A J2ee Environment? |
|
Answer» Yes, as of Seam 1.1, you can use Seam in any J2EE application server, with one caveat: you will not be able to use EJB 3.0 session beans. HOWEVER, you can use EITHER Hibernate or JPA for persistence, and you can use Seam JAVABEAN components instead of session beans. Yes, as of Seam 1.1, you can use Seam in any J2EE application server, with one caveat: you will not be able to use EJB 3.0 session beans. However, you can use either Hibernate or JPA for persistence, and you can use Seam JavaBean components instead of session beans. |
|
| 46. |
Can I Run Seam Outside Of Jboss As? |
|
Answer» YES, you can run Seam applications in plain Tomcat 5.5+ or in the SUN GlassFish APPLICATION server. To run Seam application in Tomcat, you need a number of additional library files and a few configuration files to bootstrap the JBoss EJB3 inside Tomcat. Please refer to the deploy.tomcat ANT build TARGET for the Seam booking example (in theexamples/booking DIRECTORY of the Seam distribution) for more on how to build a Tomcat WAR for Seam applications. Refer to this blog post on how to run Seam in Sun's Glassfish application server. Yes, you can run Seam applications in plain Tomcat 5.5+ or in the Sun GlassFish application server. To run Seam application in Tomcat, you need a number of additional library files and a few configuration files to bootstrap the JBoss EJB3 inside Tomcat. Please refer to the deploy.tomcat ANT build target for the Seam booking example (in theexamples/booking directory of the Seam distribution) for more on how to build a Tomcat WAR for Seam applications. Refer to this blog post on how to run Seam in Sun's Glassfish application server. |
|
| 47. |
What's Jboss Jbpm ? |
|
Answer» JBoss jBPM is a platform for process languages. At the base there is a java library to define and execute graphs. The actual process CONSTRUCTS like e.g. send email, USER task and update database are defined on top of this. Every process language is made up of a set of such process constructs. And that is what is pluggable in this base library. On top of the JBoss jBPM base library, there are IMPLEMENTED several process languages as a set of process constructs: jPDL, BPEL and SEAM pageflow: • jPDL is a process language with a clean interface to Java and very sophisticated task management CAPABILITIES. There is no standard for Java process languages, so it is proprietary. JBoss jBPM is a platform for process languages. At the base there is a java library to define and execute graphs. The actual process constructs like e.g. send email, user task and update database are defined on top of this. Every process language is made up of a set of such process constructs. And that is what is pluggable in this base library. On top of the JBoss jBPM base library, there are implemented several process languages as a set of process constructs: jPDL, BPEL and SEAM pageflow: • jPDL is a process language with a clean interface to Java and very sophisticated task management capabilities. There is no standard for Java process languages, so it is proprietary. |
|
| 48. |
Does Seam Run On Other Application Servers Besides Jboss ? |
|
Answer» Seam RUNS BEAUTIFULLY on other application servers - just like everything ELSE the HIBERNATE TEAM does, this is not a JBoss-only thing. Seam runs beautifully on other application servers - just like everything else the Hibernate team does, this is not a JBoss-only thing. |
|
| 49. |
What Do You Know About Seam ? |
|
Answer» Built on the STANDARDS JavaServer Faces and EJB 3.0, JBoss Seam unifies component and programming models and DELIVERS a consistent and powerful framework for rapid creation of web applications with Java EE 5.0. Seam simplifies web application development and enables new functionality that was difficult to implement by hand before, such as stateful conversations, multi-window operation, and handling concurrent fine-grained AJAX requests. Seam also unifies and integrates popular OPEN source technologies like Facelets, Hibernate, iText, and Lucene. Built on the standards JavaServer Faces and EJB 3.0, JBoss Seam unifies component and programming models and delivers a consistent and powerful framework for rapid creation of web applications with Java EE 5.0. Seam simplifies web application development and enables new functionality that was difficult to implement by hand before, such as stateful conversations, multi-window operation, and handling concurrent fine-grained AJAX requests. Seam also unifies and integrates popular open source technologies like Facelets, Hibernate, iText, and Lucene. |
|
| 50. |
What's Jboss Cache In Short ? |
|
Answer» JBossCache ENABLES easy distribution of datasets across your computing environments. It is BASED on JGroups and enables CLUSTERING and HIGH availability of that data. You may CHOOSE to distribute the data with JBoss Messaging to move it where it is needed for computation or event-based programming. JBossCache enables easy distribution of datasets across your computing environments. It is based on JGroups and enables clustering and high availability of that data. You may choose to distribute the data with JBoss Messaging to move it where it is needed for computation or event-based programming. |
|