Skip to main content

Freshers & Experienced Openings July 2024

https://www.pharmatutor.org/content/july-2024/biocon-biologics-walk-in-drive-for-mpharm-bpharm-msc-in-qa-qc-manufacturing

Java J2EE Interview Questions and Answers - Part 7

  1. What is connection pooling?- With servlets, opening a database connection is a major bottleneck because we are creating and tearing down a new connection for every page request and the time taken to create connection will be more. Creating a connection pool is an ideal approach for a complicated servlet. With a connection pool, we can duplicate only the resources we need to duplicate rather than the entire servlet. A connection pool can also intelligently manage the size of the pool and make sure each connection remains valid. A number of connection pool packages are currently available. Some like DbConnectionBroker are freely available from Java Exchange Works by creating an object that dispenses connections and connection Ids on request. The ConnectionPool class maintains a Hastable, using Connection objects as keys and Boolean values as stored values. The Boolean value indicates whether a connection is in use or not. A program calls getConnection() method of the ConnectionPool for getting Connection object it can use; it calls returnConnection() to give the connection back to the pool.
  2. Why should we go for interservlet communication?- Servlets running together in the same server communicate with each other in several ways. The three major reasons to use interservlet communication are: a) Direct servlet manipulation - allows to gain access to the other currently loaded servlets and perform certain tasks (through the ServletContext object) b) Servlet reuse - allows the servlet to reuse the public methods of another servlet. c) Servlet collaboration - requires to communicate with each other by sharing specific information (through method invocation)
  3. Is it possible to call servlet with parameters in the URL?- Yes. You can call a servlet with parameters in the syntax as (?Param1 = xxx || m2 = yyy).

 

  1. What is Servlet chaining?- Servlet chaining is a technique in which two or more servlets can cooperate in servicing a single request. In servlet chaining, one servlet’s output is piped to the next servlet’s input. This process continues until the last servlet is reached. Its output is then sent back to the client.
  2. How do servlets handle multiple simultaneous requests?- The server has multiple threads that are available to handle requests. When a request comes in, it is assigned to a thread, which calls a service method (for example: doGet(), doPost() and service()) of the servlet. For this reason, a single servlet object can have its service methods called by many threads at once.
  3. What is the difference between TCP/IP and UDP?- TCP/IP is a two-way communication between the client and the server and it is a reliable and there is a confirmation regarding reaching the message to the destination. It is like a phone call. UDP is a one-way communication only between the client and the server and it is not a reliable and there is no confirmation regarding reaching the message to the destination. It is like a postal mail.
  1. What is Inet address?- Every computer connected to a network has an IP address. An IP address is a number that uniquely identifies each computer on the Net. An IP address is a 32-bit number.
  2. What is Domain Naming Service(DNS)?- It is very difficult to remember a set of numbers(IP address) to connect to the Internet. The Domain Naming Service(DNS) is used to overcome this problem. It maps one particular IP address to a string of characters. For example, www. mascom. com implies com is the domain name reserved for US commercial sites, moscom is the name of the company and www is the name of the specific computer, which is mascom’s server.
  3. What is URL?- URL stands for Uniform Resource Locator and it points to resource files on the Internet. URL has four components: http://www. address. com:80/index.html, where http - protocol name, address - IP address or host name, 80 - port number and index.html - file path.
  1. What is RMI and steps involved in developing an RMI object?- Remote Method Invocation (RMI) allows java object that executes on one machine and to invoke the method of a Java object to execute on another machine. The steps involved in developing an RMI object are: a) Define the interfaces b) Implementing these interfaces c) Compile the interfaces and their implementations with the java compiler d) Compile the server implementation with RMI compiler e) Run the RMI registry f) Run the application
  2. What is RMI architecture?- RMI architecture consists of four layers and each layer performs specific functions: a) Application layer - contains the actual object definition. b) Proxy layer - consists of stub and skeleton. c) Remote Reference layer - gets the stream of bytes from the transport layer and sends it to the proxy layer. d) Transportation layer - responsible for handling the actual machine-to-machine communication.
  3. what is UnicastRemoteObject?- All remote objects must extend UnicastRemoteObject, which provides functionality that is needed to make objects available from remote machines.
  1. Explain the methods, rebind() and lookup() in Naming class?- rebind() of the Naming class(found in java. rmi) is used to update the RMI registry on the server machine. Naming. rebind(”AddSever”, AddServerImpl); lookup() of the Naming class accepts one argument, the rmi URL and returns a reference to an object of type AddServerImpl.
  2. What is a Java Bean?- A Java Bean is a software component that has been designed to be reusable in a variety of different environments.
  3. What is a Jar file?- Jar file allows to efficiently deploying a set of classes and their associated resources. The elements in a jar file are compressed, which makes downloading a Jar file much faster than separately downloading several uncompressed files. The package java. util. zip contains classes that read and write jar files.

Comments

Post a Comment

Popular Posts

DOT NET Interview Questions with Answers

When not to use Design Patterns? Do not use design patterns in any of the following situations. • When the software being designed would not change with time. • When the requirements of the source code of the application are unique. If any of the above applies in the current software design, there is no need to apply design patterns in the current design and increase unnecessary complexity in the design. When to use Design Patterns? Design Patterns are particularly useful in one of the following scenarios. • When the software application would change in due course of time. • When the application contains source code that involves object creation and event notification. Benefits of Design Patterns: The following are some of the major advantages of using Design Patterns in software development. • Flexibility • Adaptability to change • Reusability What are Design Patterns? A Design Pattern essentially consists of a p...

One-Click Video Chats

Meet Face to Face Online Hang out with co-workers and teams. Run as many meetings as you want. No software or signups needed. Best of all, it's free. Simple One-Click Video Chats from Meetings.io Meetings.io starts a video chat between you and up to five people in two simple steps: 1. Press button to generate link to video chat; 2. Share link. That's it. No registering, no logging in, no screen names to remember. Just click and start. The screen automatically resizes to accommodate participants as they come and go, and there are cool little add-ons like a notepad for personal memos and a messenger space for personal comments. Go Visit http://meetings.io --------------------------------------------------- Sourced from Netted by the Webbys

Freshers & Experienced Openings July 2024

https://www.pharmatutor.org/content/july-2024/biocon-biologics-walk-in-drive-for-mpharm-bpharm-msc-in-qa-qc-manufacturing

Streak

Streak – CRM Inside Your Inbox Many of the busiest professionals spend the majority of their days sifting through emails and responding to the most urgent matters. Streak is an application that can make the time people spend going through their email inboxes more efficient and effective. The web-app puts CRM tools right inside its users' Gmail inboxes, making it easy to complete deals and manage client relationships without clicking around from tab to tab. Streak can be used for sales management, bug tracking, customer support, or hiring, just to name a few of the many uses for this innovative tool. If you're the kind of person who spends most of your time browsing through an overflowing inbox, then you'll want to give Streak a try. To get started, add Streak to your browser – the app only works on Google Chrome at the current time – login to your account, and then visit your Gmail inbox. Streak will group the emails in your inbox by customer, making it easy to ...

PDF Presenter

PDF Presenter, an open-source, java-based utility, lets you display PDF documents the same way you'd present PPT (or PPTX) slideshows. Not only that, but you can also annotate your documents with an integrated Pen, Marker and Text Box tool. In addition, it provides you with an option to view your PDF documents (or a Whiteboard) in full screen mode. It works on Microsoft Windows, Mac OSX and Linux operating systems, requires latest JRE (Java Runtime Environment) installed. http://pdfpresenter.sourceforge.net/

Contact Form

Name

Email *

Message *