Your Ad Here

Wednesday, December 31, 2008

JSP Interview Questions & Answers

Q : What is a JSP and what is it used for?
A : Java Server Pages is a platform independent presentation layer technology that comes with SUN s J2EE platform. JSPs are normal HTML pages are with Java code pieces embedded in them. JSP pages are saved to *.jsp files. A JSP compiler is used to in the background to generate a Servlet from the JSP page.

Q : What is JSP technology?
A : Java Server Page is a standard Java extension that is defined on top of the servlet Extensions. The goal of JSP is the simplified creation and management of dynamic Web pages. JSPs are secure, platform-independent, and the best of all, make use of Java as a server-side scripting language.

Q : How many JSP scripting elements ?
A : There are three JSP scripting language elements:
• Scriptlets
• Declarations
• Expressions

Q : What is the information needed to create a TCP Socket?

A : The Remote System’s IPAddress and Port Number.
The Local Systems IP Address and Port Number.

Q : What is difference between JSP 1.0 model and JSP 2.0 model?

A : The main difference between the JSP 1.0 and JSP 2.0 has feature in that by which we can create more syntax errors due to TLD.

Q :Diffrence betweeen a statis and dynamic include?

Dynamic include means files are included at run time.
If there is any change in source file it will reflected in JSP
Static include means files are included at compile time. After inclusion if there any change in source file it will not reflect that JSP.

Q : What’s the differences between JSP LifeCycle and Servlet LifeCycle?
A : In servlet we can implement init, service and destroy method but in JSP we do not have any implementation for that i.e JSP container is taking care of that implementation . Finally only translation phase is different i.e JSP converted into servlet.

Q : What is the difference between web server and application server?
A : Application server is EJB. It can communicate will both Web and Distributed Architecture. Application server is a Component Architecture
Web server can not communicate with Component Architecture or Distributed Architecture. It consists of Servlets and JSP pages.

Q : How to Upload a textfile from JSP to Servlet ?
A . You must use this tag for Remember form tag must contain the following attribute

Enctype ="multipart/form-data" then only it will validate file upload.

Q : What’s the difference between JSP forward and servlet forward methods?

A : JSP forward forwards the control to another resource available in the same web application on the same container. where as a Servlet forward forwards the control to another resource available in the same web application or different web application on the same container.

Q : How to call EJB from JSP.?
We need to write a JavaBean which implements the code for the EJB client. This is JavaBean can interact with the JSP using useBean JSP action.

Q : What is the difference between jsp include and directive include?
A : <%@ include> : Used to include dynamic content or static content during runtime
Used to include static resources during translation time. :

Q : How does JSP handle runtime exceptions?
A: Using the error Page attribute of page directive and also we need to specify the error page isErrorPage=true if the current page is intended to URL redirecting of a JSP.

Q : What are the implicit objects?
A : Implicit objects are objects that are created by the web container and contain the information related to a particular request, page, or application. They are:
• Request
• session
• response
• pageContext
• application
• out
• exception
• config
• page

Q : What is an Expression?

A : An expression is a tag contains a scripting language expression that is evaluated, converted to a String, and inserted where the expression appears in the JSP file. Because the value of an expression is converted to a String, you can use an expression within text in a JSP file. Like
<%= someexpression %>
<%= (new java.util.Date()).toLocaleString() %> You won’t use the semicolon to end an expression.

Recent Servlets Interview Questions & Answer

Q : What is Servlets? What is the advantages of Servlet life cycle?
A : Servlets are modules that run within the server and receive and respond to the requests made by the client. Servlets retrieve most of the parameters using the input stream and send their responses using an output stream.
Servlets are used to the extend server side of functionality of a website. They communicate with various application on the server side and respond to the request made by the client.

Q : What is GenericServlet class?
A : The GenericServlet makes the writing servlets easier. To write a generic servlet, all you need to do is to override the abstract service method.

Q : What is the difference between a JavaBean from a Servlet?
A: Servlets are Java based analog to CGI programs, implemented by means of a servlet container associated with an HTTP server. Servlets run on the server side. Beans are reusable code components written in the Java that one can use in a variety of the programming environments. JavaBeans are used to Java what ActiveX controls are to Microsoft. Javabeans can run on server side, client side, within an applet etc

Q :Explain the servlet mapping?
A :Servlet mapping is the controls of how you access a servlet. It is recommended that you do not use the absolute URLs. Instead of usage of relative URLs should be done.
If you try to deploy the application with a different context root, you might have to change all the urls used in all the JSP programs. Relative URLs is the solution so that you can deploy your application with different context root with out changing the URLs.

Q: What is a Expression?
A : Expressions are act as a place holders for language expression, expression is evaluated each time the page is accessed. This shall be included in the service method of the generated servlet.

Q : What is the servlet context ?
A : The servlet context is an object that contains a information about the Web application and container. Using the context, a servlet can log events, obtain the URL and references to resources, and set of store and attributes that other servlets in the context can use.

Q : What are the different ways for session tracking?
A : There are different ways for session tracking
Cookies,
URL rewriting,
HttpSession,
Hidden form fields

Q : What are the type of protocols supported by HttpServlet?
A : Protocols extends the GenericServlet base on the class and provides an framework for handling the HTTP protocol. So, HttpServlet is the only supports HTTP and HTTPS protocol.

Q : What are the uses of Servlets?
A : Servlet can handle the multiple request concurrently and be used to develop high performance system
Servlets are used to process the client request.
A Servlet can be used to load balance among the serveral servers, as Servlet can easily forward.

Q : What is a Java Servlet?
A : A servlet is a Java technology-based Web component, managed by the container called servlet container or servlet engine, that generates the dynamic content and interacts with web clients via a request/response paradigm.

Q : What is the Servlet Interface?
A : The central abstraction is in the Servlet API is the Servlet interface. All servlets implement this interface, either directly one or, more commonly, by extending a class that implements it such as a HttpServlet. Servlets–>Generic Servlet–>HttpServlet–>MyServlet. The Servlet interface the declares, but does not implement, methods that manage the servlet and its communications with clients. Servlet writers provide some or all of these methods when developing a servlet.

Q :What are the differences between Applet and Servlet?
A : Applets are client side the components and runs on the web browsers Servlets are server side components that runs on the Servlet container.. Servlets have no GUI interface.

Q : What is GenericServlet class?
A : The GenericServlet is an abstract class that the implements the Servlet interface and the ServletConfig interface. In addition to the methods of declared in these two interfaces, this class also provides simple versions of the lifecycle methods init and destroy, and implements the log method declared in the ServletContext interface.

Recent ASP Interview Questions & Answers

Q : What’s the difference between client-side script and server-side script?
A : Scripts executed only by the browser without contacting the server is called client-side script. It is browser dependent. The scripting code is a visible to the user and hence not secure. Scripts are executed by the web server and processed by the server is called server-side script.

Q : What is Session Object?
A : Session object is stored in the information about a User’s session. Gives a notification when a user session begins or ends.

Q : What is the Server-Side includes?
Server side includes provides the extra information by which it makes the site easier to manage. It can include the text files using the #include statement, retrieve the size and last modification date of a file, defines how variables and error messages are displayed and inserts the values of HTTP variables in the page sent back to the browser.

Q : What is Response Object?
A : Response object is controls the information sent to the user. The various methods are:
Response.Write - Sends information directly to a browser
Response.Redirect - Directs a user to a URL other than the requested URL
Response.ContentType - Controls the type of content sent
Response.Cookies - Sets cookie values
Response.Buffer - To Buffer information

Q : What is a TextStream object?
A : Text Stream object allows you to access the read or write the contents of text files stored on the web server.

Q : What is Request Object?
A : Gets information from the user. It has five collections of by which values can be accessed. They are:
Querystring, Form, Cookies, Server Variables & ClientCertificate

Q : Why do we use Option Explicit?
A : Answer 1 :
Correct answer is – This statement force the declaration of variables in VB before using them.

Answer 2 :
To avoid multiple variables of the same name.

Q : What are the Web Servers supporting in ASP?
A : There are three types of web servers supporting in asp,
Internet Information Server (IIS) on Windows NT
Peer Web Services on Windows NT
Personal Web Server (PWS) on Windows 95

Q : What is asession?
A :Session is known as a user accessing an application.

Q : Explain some of the ASP components?
A : Ad Rotator component : A way to manage advertisements on the web site.
Content Linker component : A technique to direct users through a set of pages on a web site by creating a list of URLs and description of the next and previous pages.
Database Access component : Allows to access data from the database
Browser Capabilities component : Allows to customize the page to the ability of the browser viewing it.

Q : What are the advantages of using ASP?
A : Minimizes network traffic by limiting the need for the browser and server to talk to each other
Makes for quicker loading time since HTML pages are only downloaded
Can provide the client with data that does not reside on the client’s machine
Allows to run programs in languages that are not supported by the browser
Provides improved security measures since the script cannot be viewed by the brows.

Q : What is the function of Buffer in Response Object?
A : Buffer in response object controls the HTML output stream manually.

Q : What are the methods in Session Object?
A : The Session Object have only one method, which is Abandon. It destroys all the objects stored in a Session Object and releases the server resources they occupied.

Q : What is FileSystemObject object?
A : FileSystemobjaect provides access to the physical file system of the web server. It gets and manipulates the information about all drives in a server, folders and sub-folders on a drive and files inside a folder.

Q : What’s the difference between HTML and ASP?

ASP executes code on the server side whereas the browser interprets HTML.
ASP can use any of the scripting languages
Create pages that will be customized to display only things that will be of interest to a particular user
Can edit contents of a web page by updating a text file or a database rather than the HTML code itself .

Q : What are the browsers that can access ASP pages?
A: Netscape Communicator/ Navigator (supports only JavaScript, VBScript)
Internet Explorer (supports VBScript, JavaScript)

Recent C# Interview Questions & Answers

Q : What is the C# syntax to catch any possible exception?
A : A catch block is that the catches the exception of type System .Exception. You can also omit the parameter data type in this case and just write catch {}.

Q :What is the difference between System.String and System.Text.StringBuilder classes?
A : System.String is a immutable. System.StringBuilder was designed with the purpose of having a mutable the string where as a variety of operations can be performed.

Q : What’s the syntax to inherit from a class in C#?
A: A Place is a colon and then the name of the base class.
Example: class MyNewClass : MyBaseClass

Q : When do you correctly have to declare a class as abstract?
A : When the class itself is the inherited from an abstract class, but not all base abstract methods have been overridden.
When at least one of the methods in the class is abstract class.

Q : What’s the difference between a Struct and a Class?
A : Structs are the value-type variables and are thus saved on the stack, additional overhead but faster retrieval. Another difference is struct can not inherit.

Q :What are the different ways of method can be overloaded?
A: There are three types of ways can be overloaded,
Different parameter data types,
Different number of parameters,
Different order of parameters.

Q : Which is the following is used to denote comments in C#?
A : All are correct, all are supported forms of commenting. It is just that /// is specifically for functionality in XML documentation.

Q : What is true about readonly variable in C# code?

A : B is the right choice. Since readonly field can only be initialized at the time of
construction of the object. Read only means if you want to initialize the readonly property that intialize it inside the constructor.

Q : What’s an interface class?
A : It is an abstract class with the public abstract methods all of which is must be implemented in the inherited classes.

Q : What is a delegate?
A : A delegate is a object encapsulates a reference to a method. In C++ they were referred to as function pointers.

Q : What is a multicast delegate?
A Multicast delegate is that points to and eventually fires off several methods.

Q : What is the difference between the Trace class and Debug class?
A :Documentation looks the same. Use Debug class for debug builds, use the Trace class for both debug and release builds.

Q : What is Inheritance?
A :Inheritance is a process of acquiring attributes and behaviors from the another object (normally a class or interface). Gives you ability to provide is-a relationship. Acquires attributes and behaviors from another. When a class acquires attributes and behaviors from another class.

Q : What is a Destructor?
A : A destructor is a deallocating the memory.

Q : How a base class method is hidden?
A : Hiding a base class method by declaring a method in the derived class with keyword new. This will override the base class method and old method will be suppressed.

Recent VB.Net Interview Questions & Answers

Q : Define Context menu in VB.NET?
A : It is useful for enabling access to commands in a variety of contextual situations.
It is created at run time in the same manner as a main menus
It is created the using Context Menu control.

Q : Define the Validation in VB.NET?

A :Validation of two types of level validation there are,
Form-level :Validates all fields on a form simultaneously.
Field-level : Validation validates each field as data is entered.

Q : What is a visual inheritance in VB.NET?
A : A Visual inheritance allows the deriving forms from the base form with common controls.

Q : What is the difference between VB and VB.NET?
A: VB does not support inheritance, but VB.NET supports the inheritance.
VB does not support polymorphisms, but VB.NET supports Polymorphisms.
VB is OOPS based, but VB.NET completely supported for OOPS.
VB supports interfaces, but VB.NET fully supports interface based programming
VB uses VB runtime, but VB.NET uses CLR.

Q : How to store and retrieve images in sql server database through VB.NET?
A : Server supports the ability for clients to store the objects within tables.
Create the Field that data type Image and Initialize byte an array with a null value initially. Use FileInfo object to get file size. Open FileStream to read file.

Q : What is the Advantages of VB.NET?
A : First of all, VB.NET provides managed code execution that runs under the
Common Language Runtime (CLR), resulting in robust, stable and secure applications. All features of the .NET framework are readily available in VB.NET.
VB.NET is totally object oriented. This is a major of addition that VB6 and other earlier releases did not have.
VB.NET uses XML to transfer the data between the various layers in the DNA Architecture i.e. data are passed as simple text strings.
The .NET framework comes with the ADO.NET, which follows the disconnected paradigm, i.e. once the required records are fetched the connection no longer exists. It is also retrieves the records that are expected to be accessed in the immediate future. This enhances Scalability of the application to a great extent.
Error handling has changed in VB.NET. A new Try-Catch-Finally block has been introduced to handle errors and exceptions as a unit, allowing appropriate action to be taken at the place the error occurred thus discouraging the use of ON ERROR GOTO statement. This again credits to the maintainability of the code.

Q :What is the difference between DataSet and DataTable?
A : DataTable:
Represents one table of in-memory data table can have one table only or we can say Data table is a collection of record's that consist the single table
Dataset:
Represents an in-memory cache of data we can also say data set is a collection of data table it is based on xml format. It is used to for data storing in cache as a disconnected recordset dataset is using data manipulation in cache without connection to database.

Q :What is the DataType conversion in VB.NET ?
A : Convert one variable type to another one is called datatype and Another conversion we can also called this casting in VB.NET some automatically conversion is also there.

Q : What is the branching logic control in vb.net ?
A : Function and subroutines are the answer. The diffrence between in two of them is function send to the information back from where it is called means function can return a value but subroutines can not do this.

Q :What do you mean by Serialization and Deserialization and it’s use?
A: To load data from xml file to vb.net form is called DeSerialization.
To store the vb.net for data into an xml file is called Serialization.

: What are the various open source tool available for VB.NET?
A : When compared with the rapid development of open source tools for other languages from Microsoft (C#, etc) we can say the that development of tools for VB has been slow. Mono development platform is one which is implementing VB libraries are working on a compiler.

Q : What is the branching logic control in vb.net?
A : Function and subroutines are the answer. The diffrence between in two of them is function send the information back from where it is called means function can return a value but subroutines can not do this.

Recent ASP.Net Interview Questions & Answers

Q : What is ASP.NET?
A : ASP.NET is a compiled code and run the under CLR Environment because it is a Managed Code with OOPS Accepted.

Q : Differentiate between execute query and execute nonquery.?
A : Execute Query is the method of which is used to return the result of the command like select Query. Execute is Update Query.
The Execute NonQuery is used to return the Query OS the statement like the update Delete Insert which returns No data..

Q : What do you mean by the authentication and authorization?
A : Authentication is validating user rights
Authorization is validating credentials

Q : What are the types of memory management?
A :Memory management is many types such as
• Storage memory Management.
• I/O Memory Management etc ..

Q : What is a Constructor in ASP.NET?
A : Constructor is the first method that are called on instantiation of a type.
It provides the way to set of default values for data before the object is available for use.
Performs other necessary functions before the object is available for use.

Q : Explain the serialization in ASP.NET?
A : Serialization is a process of converting an object into a stream of bytes. .Net has 2 serializers namely XMLSerializer and SOAP/BINARY Serializer. Serialization is maily used in the concept of .Net Remoting.


Q :What is Destructor in ASP.NET?

A : destructor is called the just before an object is destroyed. It can be used to run clean-up code. You cannot control when a destructor is called since object clean up by common language runtime.

Q : what are the components of web form in ASP.NET explain it?
A: Server controls : The server controls are Hypertext Markup Language (HTML) elements that include a runat=server attribute. They are provide the automatic state management and server-side events and respond to the user events by executing event handler on the server.

Data controls : Data controls are allow to the connect to the database, execute command and retrieve data from database.

HTML controls :These controls also respond to the user events but the events processing happen on the client machine.


System components : System components provide access to system-level events that occur on the server.

Q : Explain the different parts that constitute ASP.NET application?
A : ASP.NET Applications are three parts of constitute there are,
(i) Content files (ii) Program logic files (iii) Configuration file
Content files include static text, images and can be include elements from database.
Program logic files exist as DLL file on the server that responds to the user actions.
Configuration file to the offers various settings that determine how is the application runs on the server.

Q : Describe the sequence of action takes place on the server when ASP.NET application starts first time?
A : Following are the sequences:
IIS starts ASP.NET worker process>> worker process loads assembly in the memory>>IIS sends the request to the assembly>>the assembly composes a response using the program logic>> IIS returns the response to the user in the form of HTML.

Q : What’s the main difference between FormLayout and GridLayout ?
A :FormLayout is a little of different only experience Web Developer used this one reason is it is helpful for wider range browser. If there is any absolute positioning we can notice that there are number of DIV tags. But in FormLayout whole work are done through the tables. But Grid Layout helps in providing absolute positioning of every control placed on the page. It is easier to develop page with absolute positioning because control can be placed any where according to our requirement.

Q :Differentiate between WebCustomControl and in WebUserControl?
A: Web custom controls:-Web Custom Control is a typical to create and good for the dynamic layout and another thing is it have full tool support for user and a single copy of control is required because it is placed in Global Assembly cache.
Web user controls :- Web User Control is Easier to create and another thing is that its support is limited for users who use a visual design tool one gud thing is that its contains static layout one more thing a seprate copy is required for each application.

Q : What Language is familiar to CLR?
A: Any language that can be compiled into Microsoft Intermediate Language (MSIL) is considered a .NET-compliant language. Following are a few part of the popular .NET-compliant languages supported by CLR.

XML Interview Questions & Answers

Q : How can u create an XML file?
A : It is a quite easy to create, can create by the plain text editor like notepad or by .net model using so many in built methods like XmlTextWriter etc.

Q : What is a XML Namespace?
A : Defining a namespace to avoid the confusion involves using a prefix and adding an xmlns attribute to the tag to give the prefix a qualified name associated with the namespace. All the child elements with the same prefix are associated with the namespace defined in the start tag of an element.

Q : What’s the difference between SAX parser and DOM parser?
A : SAX parser - works incrementally and generate the events that are passed to the application. It does not generate data representation of xml content so some programming is required. However, it provides the stream processing and partial processing which cannot be done alone by DOM parser.
DOM parser - reads the whole XML document and returns a DOM tree representation of xml document. It provides a convenient way for reading, analyzing and manipulating XML files. It is not well a suited for the large xml files, as it always reads the whole file before processing.

Q : Describe the differences between XML and HTML?
A : XML :
• User definable tags
• Content driven End tags required for well formed documents
• Quotes required around attributes values
• Slash required in empty tags

HTML :
• Defined set of tags designed for web display
• Format driven
• End tags not required
• Quotes not required
• Slash not required

Q : What is DOM?
A : The Document Object Model (DOM) is an interface specification maintained by the W3C DOM Workgroup that defines is an application independent mechanism
to access, parse, or update XML data. In the simple terms it is a hierarchical model that allows developers to manipulate XML documents easily.

Q :Why is XML such an important development?
A : XML removes the two constraints which were holding the back Web developments: dependence on a single, inflexible document type (HTML); the complexity of full SGML.

Q : What is a XPointer?
A : XPointer is a set of recommendations developed by the W3C. The core recommendations are the XPointer Framework which provides an extensible addressing behavior for fragment identifiers in XML media types.
XPointer gains its extensibility through the XPointer Framework, which identifies the syntax and processing architecture for XPointer expressions and through an extensible set of XPointer addressing schemes. These schemes, e.g., element() or xpointer(), are actually QNames. The xmlns() scheme makes it possible for an XPointer to declare namespace bindings and thereby the use third-party schemes as readily as W3C defined XPointer schemes.

Q : What is the three essential components of security does the XML Signatures provide?
A : Authentication, message integrity, and non-repudiation. In addition to signature information, an XML Signature can also contain the information describing the key used to sign the content.

Q :What’s an XML namespace prefix?
A : An XML namespace prefix is a prefix used to specify that a local element type or attribute name is in a particular XML namespace.

Q : Why is XML such an important development?
A : XML removes the two constraints which were holding back Web developments:
1. Dependence on a single, inflexible document type (HTML) which was being much abused for tasks it was never designed for;
2. The complexity of full SGML, whose syntax allows many powerful but hard-to-program options.
XML allows the flexible development of user-defined document types. It provides a robust, non-proprietary, persistent, and verifiable file format for the storage and the transmission of text and data both on and off the Web, and it’s remove the more complex options of SGML, making it easier to program for.

J2ME Interview Questions & Answers

Q : What is J2ME ?
A : Java 2 Micro Edition(J2ME) is a group of specifications and technologies that pertain to Java on small devices. The J2ME moniker covers a wide range of devices, from the pagers and mobile telephones through the set-top boxes and car navigation systems. The J2ME world is divided into the configurations and profiles, specifications that describe a Java environment for a specific class of device.

Q : What is the Generic Connection Framework ?
A : The Generic Connection Framework (GCF) makes it is very easy for wireless devices to make the network connections. It is part of a CLDC and CDC and resides in the javax.microedition.io package.

Q : What is a RMI ?
A : Remote method invocation (RMI) is a feature of J2SE that enables to the Java objects running in one virtual machine to invoke the methods of Java objects running in another virtual machine, seamlessly.

Q : What’s WDP?
A : Wireless Datagram Protocol (WDP)is worked as the transport layer of WAP. WDP processes datagrams from the upper layers to formats required by the different physical datapaths like GSM SMS or CDMA Packet Data. WDP is adapted to the bearers available in the device so upper layers do not need to the care about the physical level.

Q : What is JCP ?
A : The Java Community Process (JCP) is an open the organization of international Java developers and licensees who develop and revise Java technology specifications, reference the implementations, and technology compatibility kits through a formal process.

Q : What is a OTA ?
A : Over The Air (OTA) refers to any the wireless networking technology.

Q : What is kXML ?
A : The kXML project provides a small of footprint XML parser that can be used with the J2ME.

Q : What is PCS ?
A : Personal Communications Service (PCS) is a suite of second-generation, digitally modulated mobile-communications the interfaces that includes TDMA, CDMA, and GSM. PCS serves as an umbrella term for the second-generation wireless technologies operating in the 1900MHz range.

Q :What is the Personal Profile ?

A The Personal Profile is a J2ME profile the specification. Layered on the Foundation Profile and CDC, the Personal Profile will be the next generation of PersonalJava technology. The specification is currently in development under the Java Community Process (JCP).

Q : What is TDMA ?
A: Time Division Multiple Access (TDMA) is a second-generation modulation standard using bandwidth the allocated in the 800 MHz, 900 MHz, and 1900MHz ranges.

Q : What is WTLS ?
A : Wireless Transport Layer Security protocal (WTLS) does all cryptography oriented features of WAP. WTLS handles encryption/decryption, user authentication and data integrity. WTLS is based on the fixed network Transport Layer Security protocal (TLS), formerly known as Secure Sockets Layer (SSL).

Q : What ‘s WTP ?
A : Wireless Transaction Protocol (WTP) is WAP's transaction protocol that works between the session protocol WSP and security protocol WTLS. WTP chops data packets into lower level datagrams and concatenates received datagrams into useful data. WTP also keeps track of received and sent packets and does re-transmissions and acknowledgment sending when needed.

Q : What is WMLScript
A : WMLScript is a subset of the JavaScript scripting language designed to as part of the WAP standard to provide a convenient mechanism to access the mobile phone's peripheral functions.

Your Ad Here