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 5

  1. Which containers use a Border layout as their default layout?- Window, Frame and Dialog classes use a BorderLayout as their layout.
  2. Which containers use a Flow layout as their default layout?- Panel and Applet classes use the FlowLayout as their default layout.
  3. What are wrapper classes?- Wrapper classes are classes that allow primitive types to be accessed as objects.
  1. What are Vector, Hashtable, LinkedList and Enumeration?- Vector : The Vector class provides the capability to implement a growable array of objects. Hashtable : The Hashtable class implements a Hashtable data structure. A Hashtable indexes and stores objects in a dictionary using hash codes as the object’s keys. Hash codes are integer values that identify objects. LinkedList: Removing or inserting elements in the middle of an array can be done using LinkedList. A LinkedList stores each object in a separate link whereas an array stores object references in consecutive locations. Enumeration: An object that implements the Enumeration interface generates a series of elements, one at a time. It has two methods, namely hasMoreElements() and nextElement(). HasMoreElemnts() tests if this enumeration has more elements and nextElement method returns successive elements of the series.
  2. What is the difference between set and list?- Set stores elements in an unordered way but does not contain duplicate elements, whereas list stores elements in an ordered way but may contain duplicate elements.
  3. What is a stream and what are the types of Streams and classes of the Streams?- A Stream is an abstraction that either produces or consumes information. There are two types of Streams and they are: Byte Streams: Provide a convenient means for handling input and output of bytes. Character Streams: Provide a convenient means for handling input & output of characters. Byte Streams classes: Are defined by using two abstract classes, namely InputStream and OutputStream. Character Streams classes: Are defined by using two abstract classes, namely Reader and Writer.
  1. What is the difference between Reader/Writer and InputStream/Output Stream?- The Reader/Writer class is character-oriented and the InputStream/OutputStream class is byte-oriented.
  2. What is an I/O filter?- An I/O filter is an object that reads from one stream and writes to another, usually altering the data in some way as it is passed from one stream to another.
  3. What is serialization and deserialization?- Serialization is the process of writing the state of an object to a byte stream. Deserialization is the process of restoring these objects.
  1. What is JDBC?- JDBC is a set of Java API for executing SQL statements. This API consists of a set of classes and interfaces to enable programs to write pure Java Database applications.
  2. What are drivers available?- a) JDBC-ODBC Bridge driver b) Native API Partly-Java driver c) JDBC-Net Pure Java driver d) Native-Protocol Pure Java driver
  3. What is the difference between JDBC and ODBC?- a) OBDC is for Microsoft and JDBC is for Java applications. b) ODBC can’t be directly used with Java because it uses a C interface. c) ODBC makes use of pointers which have been removed totally from Java. d) ODBC mixes simple and advanced features together and has complex options for simple queries. But JDBC is designed to keep things simple while allowing advanced capabilities when required. e) ODBC requires manual installation of the ODBC driver manager and driver on all client machines. JDBC drivers are written in Java and JDBC code is automatically installable, secure, and portable on all platforms. f) JDBC API is a natural Java interface and is built on ODBC. JDBC retains some of the basic features of ODBC.
  1. What are the types of JDBC Driver Models and explain them?- There are two types of JDBC Driver Models and they are: a) Two tier model and b) Three tier model Two tier model: In this model, Java applications interact directly with the database. A JDBC driver is required to communicate with the particular database management system that is being accessed. SQL statements are sent to the database and the results are given to user. This model is referred to as client/server configuration where user is the client and the machine that has the database is called as the server. Three tier model: A middle tier is introduced in this model. The functions of this model are: a) Collection of SQL statements from the client and handing it over to the database, b) Receiving results from database to the client and c) Maintaining control over accessing and updating of the above.
  2. What are the steps involved for making a connection with a database or how do you connect to a database? a) Loading the driver : To load the driver, Class. forName() method is used. Class. forName(”sun. jdbc. odbc. JdbcOdbcDriver”); When the driver is loaded, it registers itself with the java. sql. DriverManager class as an available database driver. b) Making a connection with database: To open a connection to a given database, DriverManager. getConnection() method is used. Connection con = DriverManager. getConnection (”jdbc:odbc:somedb”, “user”, “password”); c) Executing SQL statements : To execute a SQL query, java. sql. statements class is used. createStatement() method of Connection to obtain a new Statement object. Statement stmt = con. createStatement(); A query that returns data can be executed using the executeQuery() method of Statement. This method executes the statement and returns a java. sql. ResultSet that encapsulates the retrieved data: ResultSet rs = stmt. executeQuery(”SELECT * FROM some table”); d) Process the results : ResultSet returns one row at a time. Next() method of ResultSet object can be called to move to the next row. The getString() and getObject() methods are used for retrieving column values: while(rs. next()) { String event = rs. getString(”event”); Object count = (Integer) rs. getObject(”count”);
  3. What type of driver did you use in project?- JDBC- ODBC Bridge driver (is a driver that uses native(C language) libraries and makes calls to an existing ODBC driver to access a database engine).

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 *