0
Alien head

programming languages Online Quiz - 1

Description: programming languages Online Quiz - 1
Number of Questions: 20
Created by:
Tags: programming languages

We all know about the Dynamic dispatch in java. But if there is dynamic dispatch , then is there a Static dispatch also? (Easy One...)

  1. True

  2. False

Answer: 1

Classes can be created at the runtime. ie; A class during its execution can create another class at the runtime, give it methods,decide what parameters should go into those methods, which all interfaces it should implement etc...

  1. True

  2. False

Answer: 1

Annonymous Inner classes are not possible within an Interface.

  1. True

  2. False

Answer: 2

In Static inner classes, the data members and the member functions are by default static.

  1. True

  2. False

Answer: 2

Classes in Java cannot be made static.

  1. True

  2. False

Answer: 2

Which of the following combinations (Design Pattern - Functionality) regarding Design Patterns is correct?

  1. Business Delegate - Reduces the coupling between presentation-tier clients and business services.

  2. Data Access Object - Multiple View using the same model.

  3. MVC - Enables easier migration to different persistence storage implementation.

  4. Value Object - Reduces Network Traffic

Answer: 4

Which of the following statements are true about the given method declaration? MyEJBObject createWithName(String name) throws CreateException, RemoteException

  1. It is declared in the local home interface of a stateful session bean.

  2. It is declared in the local home interface of a stateless session bean.

  3. It is declared in the remote home interface of a stateful session bean.

  4. It is declared in the remote home interface of a stateless session bean.

Answer: 3

Which method cannot be called by a stateful session bean using bean-managed transactions?

  1. getUserTransaction()

  2. getRollbackOnly()

  3. getStatus()

  4. None of these

Answer: 2

A container-managed persistence (CMP) entity bean A has a one-to-many unidirectional relationship (CMR) to another container-managed persistence (CMP) entity bean B. Which interface can expose the methods related to this relationship?

  1. Only local interface of bean A

  2. Local interfaces of both beans A and B

  3. Only local home interface of bean A

  4. Local home interfaces of both beans A and B

Answer: 1

You want to locate an existing bean object but do not want to create a new instance, if an existing instance is not available. Which of the following bean attributes will you use in the jsp:useBean action?

  1. class

  2. type

  3. beanName

  4. class and type

  5. beanName and type

Answer: 2

Which of the following is NOT an advantage of using the SessionFacade pattern?

  1. Hides model complexity from the client

  2. Reduces network traffic

  3. Provides a simple interface to the client

  4. Enables the client to control transactions

Answer: 4

Which enterprise bean type is defined without any client view interfaces?

  1. BMP Entity bean

  2. CMP Entity bean

  3. Stateful Session bean

  4. Stateless Session bean

  5. Message Driven Bean

Answer: 5

Your application supports multiple client types including HTTP clients. Your business layer is implemented using Enterprise Java Beans. Which of the following is best suited for maintaining client state?

  1. Cookies

  2. Entity Beans

  3. HttpSession attributes

  4. Stateful session beans

  5. URL Rewriting

Answer: 4

A transactional client receives TransactionRolledBackException from a call to a method on an entity bean. What could be the possible reason(s) for this?

  1. The bean method is throwing a checked exception and is configured with a transaction attribute of "Required".

  2. The bean method is throwing an unchecked exception and is configured with a transaction attribute of "Required".

  3. The bean does not throw an exception but is configured with a transaction attribute of "Mandatory".

  4. The bean method is throwing an unchecked exception and is configured with a transaction attribute of "Requires New".

Answer: 2

Which one of the following ServletRequest interface method returns more than one value associated with parameter?

  1. getParameterValue()

  2. getParameters()

  3. getParamValues()

  4. getParameterValues()

Answer: 4

You want to use URL rewriting to support client browsers, which do not use cookies. Which method will you use to attach the session id to a URL that is to be used for the sendRedirect() method of the HttpServletResponse?

  1. encodeURL

  2. encodeRedirectURL

  3. encodeSessionURL

  4. encodeSessionRedirectURL

  5. None of these

Answer: 2

The variables local to the methods like service(), doPost() and doGet() are thread safe. True/False?

  1. True

  2. False

Answer: 1

Which of the following aren't the methods for state/session management in the context of Servlets?

  1. Http Redirects

  2. Hidden Variables

  3. Cookies

  4. Rewritten URLs

  5. Using HttpSession Interface

Answer: 1
+ View questions