- What is an interface?
Answer: A special, completely abstract class (no implementation or attributes).
- What is an inner class? Example of use?
Answer: One class defined (coded) within the body of another.
- Does Java support multiple inheritance?
Answer: Technically, no. But you can simulate something close by using interfaces.
- What does a final data; final method; final class mean?
Answer: Final data: data becomes a compile-time constant
Answer: Final method: an inherited class cannot override the method
Answer: Final class: you cannot inherit from this class.
- Define "servlet"
Answer: A piece of code that runs on a server.
Answer: HTTPServlet returns HTML code
- Any multithreading issues with servlets?
Answer: Yes. A server will use a pool of threads to run the servlets. Therefore, the servlet must be threadsafe.
- How do you make a servlet threadsafe:
Answer: Synchronize all calls to any shared data.
- What is a JSP?
Answer: Stands for Java Server Page
Answer: A page that contains HTML and Java code within.
- What is the Remote Interface?
Answer: It is the reference to the interface that links to some stub code that will call the remote object on the remote machine. It "feels" like a regular object, but is, in fact, an interface to the remote object.
- What steps must the implementation of the remote interface do?
Answer: Create the RMISecurity manager class
Answer: Create one or more instances of the remote class
Answer: Register at least one instance of the remote class with the registry
- What function does the RMIREGISTRY serve?
Answer: Tells the caller where to find an instance of the requested class.
- What does the rmic tool do?
Answer: Creates the stubs and skeletons
- What are the stubs and skeletons used for?
- What is the difference between RMI and CORBA?
Answer: RMI is Java only while CORBA allows the use of objects written in different languages.
- What are the following components:
Answer: The service provided by an application server vendor in which your EJBs will run.
Java Naming and Directory Interface (JNDI)
Answer:The equivalent of a naming service that allows client applications to find an instance of an EJB
Java Transaction API/Service (JTA/JTS)
Answer: Lets the container manage the transactionality of an EJB
- What are the following pieces of an EJB component:
Answer: This is the actual implementation of a bean that will run within a container
Answer: Used to create an instance of an EJB (or find an instance already created)
Answer: Defines the public methods that your EJB will support
Answer: An XML file containing the configuration information (such as the names of the Home and Remote interfaces, the name published in JNDI, the transactional attributes, and any ACL information) for your EJB.
- What is a stateless session bean?
Answer: EJB that do not save any state information within itself and is mapped to a client.
- What is an Entity bean?
Answer: Maintain persistent data
Answer: Shared among clients.
- What is Container Managed Persistence?
Answer: The container is responsible for managing the persistence of the entity bean
- What is Bean Managed Persistence?
Answer: The bean itself is responsible for managing its own persistence.
question: Explain the concept of a transaction?
Answer: Transaction begins with the valid SQL statement. Transaction begins when you connect to the database. It ends after commit or rollback.
question: What is a two-phase commit?
question: How would you implement a many-to-many relationship in a database?
Answer: Should produce a mapping table between the two tables
question: Draw an inheritance relationship in UML.
question: What is a sequence diagram used for? sequence diagram shows the time based dynamics of the interaction.
question: What is an activity diagram used for? - activity diagram describes activities that occur within use case in the sequence.
question: What is a DTD?
Answer: Defines the correct format of a well-formed XML document.
question: What is the difference between a SAX parser and a DOM parser?
Answer: SAX does an in-line parse of the file (ie: it calls the appropriate code as it hits the tag.
Answer: DOM creates an object model of the XML document that can then be worked with.
question: What is public, private, protected?
question: What is static typing?
Answer: Type safety at compile time
question: What is dynamic typing?
Answer: Type safety at runtime
question: What is a friend class?
Answer: Friends can see your private parts
question: What is operator overloading?
Answer: Redefine a C++ operator
question: Should local variables be declared at the top of a function of near Ist usage?
Answer: Near 1st use for performance and readability
question: Leading cause of bugs?
question: What are templates?
Answer: Allow sharing of code among structurally similar families of classes/functions.
question: What are containers?
Answer: An object that holds other objects.