Friday, 7 September 2012

Java - JSP Multiple Choice Questions with answers for freshers and experienced free download

75 TOP Java - JSP Multiple Choice Questions with answers for freshers and experienced free download
1. What is a thin-client application?
2. What is a J2EE component?
3. What advantage does an entity bean have over a session bean?
4. When do you use a session bean?
5. Why would you design a J2EE application so user data is entered by way of a JavaServer Page and managed by an underlying JavaBeans class?
6. Why is XML a good way to transfer text-based data from one program or tool to another?
7. What part of the J2EE platform handles data storage and retrieval on behalf of a container-managed entity bean?
8. What is bean-managed persistence?
9. How are life cycle methods called?
10. In a multitiered application, which tier is the browser in?
11. Which of the following is true of cloud computing?
12. What is private cloud?
13. Amazon Web Services is which type of cloud computing distribution model?
14. Google Docs is a type of cloud computing.
15. What is Cloud Foundry?
16. This is a software distribution model in which applications are hosted by a vendor or service provider and made available to customers over a network, typically the Internet.
17. Which of the following statements about Google App Engine (GAE) is INCORRECT.
18. I've a website containing all static pages. Now I want to provide a simple Feedback form for end users. I don't have software developers, and would like to spend minimum time and money. What should I do?
19. What is the name of the organization helping to foster security standards for cloud computing?
20. "Cloud" in cloud computing represents what?
21. What exception is thrown when Servlet initialization fails ?
22. How can a Servlet call a JSP error page ?
23. What is the key difference between using a and HttpServletResponse.sendRedirect()?
24. Why beans are used in J2EE architecture in stead of writing all the code in JSPs ?
25. Why DB connections are not written directly in JSPs ?
26. How multiple EJB instances are managed?
27. At what stage, the life cycle of a CMP bean can be assumed to be started ?
28 . In JSP, how can you know what HTTP method (GET or POST) is used by client request ?
29. What is legal about JSP scriplets
30. Which method is called first each time a Servlet is invoked ?
31. What is the output of following piece of code ?
32. In a JSP page, a statement is declared as follows: And below that, an _expression appears as: What is the output of this _expression,
33. A method is defined in a class as : void processUser(int i) { } If this method is overriden in a sub class,_
34.Which of the following is true ?
35. A Vector is declared as follows. What happens if the code tried to add 6 th element to this Vector new vector(5,10)
36. A class can be converted to a thread by implementing the interface ___
37. What is the output of following block of program ?
38. ejbCreate() method of CMP bean returns
39. Explanation: ejbCreate() method of BMP bean returns the Primary Key, where as ejbCreate() method of CMP bean returns null.How can a EJB pass it’s reference to another EJB ?Which of the following is correct syntax for an Abstract class ?
40. HashMap is thread-safe whereas Hashtable is not10, Which of the following assignment  statements is invalid?
41. What will happen when you attempt to compile and run the following code snippet?
42. Given the following code segment. In what order will the output be produced?
43. Which of the following are static methods of Thread class?
44. Given the following code:
45. What will happen when you compile and run the following code?
46. Assume the following method is properly synchronized and called from a thread A on an object B:wait(2000);After calling this method, when will the thread A become a candidate to get another turn at the CPU?
47.  for(Object obj: expression) { }What interface must the ?expression? implement in order for you to use it with enhanced for loop construct?
48. You are developing an application via Java Web Start. The JAR files are signed. You want the client to get full system access, when trusted by the user. Referring to the scenario above, what do you add to the JNLP file?
49. Given:class Top {   public Top(String s) { System.out.print("B"); } } publicclass Bottom2 extends Top {   public Bottom2(String s) { System.out.print("D"); }   public static void main(String [] args) {     new Bottom2("C");     System.out.println(" ");   } }
50. Given:TreeSet map = new TreeSet();map.add("one");map.add("two");map.add("three");map.add("four"};map.add("one");Iterator it = map.iterator();while (it.hasNext() ) {System.out.print( it.next() + " " );}
51. Which is true about a method-local inner class?
52. Which is true about an anonymous inner class?
53. Which is true?
54. Which of the following statement is true?
55. Select a statement that best indicate a situation with low coupling.
56. Applications in a J2EE architecture
57. The EJB specification architecture does NOT define
58. What executes EJB components?
59. What type of enterprise bean is used to embody application processing state information?
60. Which interfaces must be implemented by Message driven beans?(3 correct answers)
61. Which describes best an EJB handle?
62. When a developer declares an EJB local reference, what element does NOT need to be specified?
63. For a stateful session bean, which method is activated by the container to save the state ofthe bean?
64. The EJB SessionContext can be used to get information about users calling session enterprisebeans. Which information can NOT be retrieved?
65. Client programs that access EJBs make use of the Java Naming and Directory Interface(JNDI). To get access to a Person entity bean, which methods can be used?(2 correct answers).
66. Which methods should NOT be defined inside the home interface of a session bean?(2 correct answers)
67. The persistence of Person and Address information in an application is implemented via BMPentity beans. Each Person must have exactly one Address. If a Person contains the primarykey for Address in a persistent field, how should you implement the Person EJB methods?(2 correct answers)
68. What would be a typical use of ejbSelect() methods?
69. Before a message-driven bean (MDB) can be tested, the J2EE application server has beeninstalled on a test machine and a connection factory and destination have been configured forthe JMS provider. What other configuration task MUST be completed before the MDB can betested on the test server?
70. A course enrolment application needs to define a JDBC resource reference for a DB2 databasein the deployment descriptor. Assuming that the name of the resource reference is "enrolment",what is the appropriate JNDI declaration?
71. CMP fields in EJB 2.x are defined via
72. In order to use Container Managed Relations (CMR) fields in CMP entity beans, the developer Must
73. The EJB Query Language is used
74. Container managed transactions are defined via trans-attributes in the deployment descriptor.When a session bean demarcates the transaction and calls an Entity Bean, what is the besttransactional setting for the Entity Bean?
75. When a packaged enterprise application (EAR file) is deployed to the application server, whichactivities can be performed? (2 correct answers)

No comments: