Free since 2005 · No login required
AT

Academic Tutorials

Learn at your own pace

site-mobile-top-banner · 320x50

Interview Q&A

  • How to create a function using function constructor?

    The following example illustrates this It creates a function called square with argument x and returns x multiplied by itself. var square = new Function ("x","return x*x");

  • What does break and continue statements do?

    Continue statement continues the current loop (if label not specified) in a new iteration whereas break statement exits the current loop.

  • What does the delete operator do?

    The delete operator is used to delete all the variables and objects used in the program ,but it does not delete variables declared with var keyword.

  • Does javascript have the concept level scope?

    No.Javascript does not have block level scope,all the variables declared inside a function possess the same level of scope unlike c,c++,java.

  • What does undefined value mean in javascript?

    Undefined value means the variable used in the code doesnt exist or is not assigned any value or the property doesnt exist.

  • What is the difference between an alert box and a confirmation box?

    An alert box displays only one button which is the OK button whereas the Confirm box

  • Are Java and JavaScript the Same?

    No.java and javascript are two different languages. Java is a powerful object - oriented programming language like C++,C whereas Javascript is a client-side scripting language with some limitations.

  • Is a javascript script faster than an ASP script?

    Yes.Since javascript is a client-side script it does require the web server's help for its computation,so it is always faster than any server-side script like ASP,PHP,etc.

  • Where are cookies actually stored on the hard disk?

    This depends on the user's browser and OS. In the case of Netscape with Windows OS,all the cookies are stored in a single file called cookies.txt

  • How to detect the operating system on the client machine?

    In order to detect the operating system on the client machine, the navigator.appVersion string (property) should be used.

  • How to read and write a file using javascript?

    I/O operations like reading or writing a file is not possible with client-side javascript. However , this can be done by coding a Java applet that reads files for the script.

  • What is JavaScript?

    JavaScript is a platform-independent,event-driven, interpreted client-side scripting and programming language developed by Netscape Communications Corp. and Sun Microsystems.

  • what is the use of Object Factories?

    Factory methods that will be used to create objects just like in a static way.

  • Explain JMX Concepts and Architecture ?

    MX is conceptually simple, yet bears the fruit of years of domain experience and research. In a nutshell, JMX defines a standard means for applications to expose management functionality 1)Instrumentation level 2)Agent level 3)Management...

  • What is JMX?

    JMX is native to the Java programming language. As a result, it offers natural, efficient, and lightweight management extensions to Java-based functions. It consists of a set of specifications and development tools for managing Java environ...

  • Which is the best tool for monitoring Weblogic server(WLS8)?

    WLS8 supports JMX but it uses weblogic implementation of JMX server. It does not supports generalise sun javax API which can be used with any JVM. There are some patches available which can be used with WLS8 which will enabled JMX b...

  • What is the use of MapMessage?

    A MapMessage carries name-value pair as it's payload. Thus it's payload is similar to the java.util.Properties object of Java. The values can be Java primitives or their wrappers

  • What is the use of TextMessage?

    TextMessage contains instance of java.lang.String as it's payload. Thus it is very useful for exchanging textual data. It can also be used for exchanging complex character data such as an XML document.

  • What is the basic difference between Publish Subscribe model and P2P model?

    Publish Subscribe model is typically used in one-to-many situation. It is unreliable but very fast. P2P model is used in one-to-one situation. It is highly reliable.

  • What is the use of Message object?

    Message is a light weight message having only header and properties and no payload. Thus if theIf the receivers are to be notified abt an event, and no data needs to be exchanged then using Message can be very efficient.

  • What is the difference between topic and queue?

    A topic is typically used for one to many messaging i.e. it supports publish subscribe model of messaging. While queue is used for one-to-one messaging i.e. it supports Point to Point Messaging.

  • What are the different messaging paradigms JMS supports?

    Publish and Subscribe i.e. pub/suc and Point to Point i.e. p2p.

  • What are the different types of messages available in the JMS API?

    Message, TextMessage, BytesMessage, StreamMessage, ObjectMessage, MapMessage are the different messages available in the JMS API.

  • What are the advantages of JMS?

    JMS is asynchronous in nature. Thus not all the pieces need to be up all the time for the application to function as a whole. Even if the receiver is down the MOM will store the messages on it's behalf and will send them once it comes back...

  • How JMS is different from RPC?

    In RPC the method invoker waits for the method to finish execution and return the control back to the invoker. Thus it is completely synchronous in nature. While in JMS the message sender just sends the message to the destination and contin...

  • What is JMS?

    JMS is an acronym used for Java Messaging Service. It is Java's answer to creating software using asynchronous messaging. It is one of the official specifications of the J2EE technologies and is a key technology.

  • What is the difference between a Server, a Container, and a Connector? -

    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 conn...

  • What are the callback methods in Entity beans?

    The bean class defines create methods that match methods in the home interface and business methods that match methods in the remote interface. The bean class also implements a set of callback methods that allow the container to notify the...

  • Can a Session Bean be defined without ejbCreate() method?

    The ejbCreate() methods is part of the bean’s lifecycle, so, the compiler will not return an error because there is no ejbCreate() method. However, the J2EE spec is explicit: the home interface of a Stateless Session Bean must have a single...

  • What is bean managed transaction?

    If a developer doesn't want a Container to manage transactions, it's possible to implement all database operations manually by writing the appropriate JDBC code. This often leads to productivity increase, but it makes an Entity Bean incompa...

  • What is EJBDoclet?

    EJBDoclet is an open source JavaDoc doclet that generates a lot of the EJB related source files from custom JavaDoc comments tags embedded in the EJB source file.

  • What is an EJB Context?

    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...

  • Why is ejbFindByPrimaryKey mandatory?

    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 thi...

  • What is the difference between session and entity beans? When should I use one or the other?

    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 (...

  • What is the default transaction attribute for an EJB?

    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 t...

  • Is it legal to have static initializer blocks in EJB?

    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 stati...

  • Is it legal to have static initializer blocks in EJB?

    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 stati...

  • What are the different kinds of enterprise beans?

    Stateless session bean- An instance of these non-persistent EJBs provides a service without storing an interaction or conversation state between methods. Any instance can be used for any client. Stateful session bean- An instance of thes...

  • Give the Details of XML files used in Validator Framework?

    The Validator Framework uses two XML configuration files validator-rules.xml and validation.xml. The validator-rules.xml defines the standard validation routines, these are reusable and used in validation.xml. to define the form specific va...

  • What is ActionForm?

    An ActionForm is a JavaBean that extends org.apache.struts.action.ActionForm. ActionForm maintains the session state for web application and the ActionForm object is automatically populated on the server side with data entered from a form o...

  • What is Action Class?

    The Action Class is part of the Model and is a wrapper around the business logic. The purpose of Action Class is to translate the HttpServletRequest to the business logic. To use the Action, we need to Subclass and overwrite the execute() m...

  • What is ActionMapping?

    1. Associates an action name with an action. 2. It can contain reference to a form bean that the action can use. 3. Defines a list of local forwards that are visible only to this action.

  • How to get data from the velocity page in a action class?

    We can get the values in the action classes by using data.getParameter(\"variable name defined in the velocity page\");

  • What is Struts Flow?

    Struts Flow is a port of Cocoon's Control Flow to Struts to allow complex workflow, like multi-form wizards, to be easily implemented using continuations-capable JavaScript. It provides the ability to describe the order of Web pages that ha...

  • What are Tag Libraries provided with Struts?

    Struts provides a number of tag libraries that helps to create view components easily. These tag libraries are: a) Bean Tags: Bean Tags are used to access the beans and their properties. b) HTML Tags: HTML Tags provides tags for creating...

  • What is Struts Validator Framework?

    Struts Framework provides the functionality to validate the form data. It can be use to validate the data on the users browser as well as on the server side. Struts Framework emits the java scripts and it can be used validate the form data...

  • What is Jakarta Struts Framework?

    Jakarta Struts is open source implementation of MVC (Model-View-Controller) pattern for the development of web based applications. Jakarta Struts is robust architecture and can be used for the development of application of any size. Struts...

  • What is Struts?

    The core of the Struts framework is a flexible control layer based on standard technologies like Java Servlets, JavaBeans, ResourceBundles, and XML, as well as various Jakarta Commons packages. Struts encourages application architectures ba...

  • What type of constraints can ServletResponse interface set on the client?

    It can set the content length and MIME type of the reply. It also provides an output stream, ServletOutputStream and a Writer through which the servlet can send the reply data.

  • What is the difference between HttpServlet and GenericServlet?

    A GenericServlet has a service() method aimed to handle requests. HttpServlet extends GenericServlet and adds support for doGet(), doPost(), doHead() methods (HTTP 1.0) plus doPut(), doOptions(), doDelete(), doTrace() methods (HTTP 1.1). B...