77 . You need to replace ASP scripts. What J2EE technology do you use?
- JMS, JSP and Servlets
- JSP and Servlets
- JTA, JSP and Servlets
- Applets
78 . As part of your new application you need to connect to a database. You don’t have any access to the database server so you can’t change the ODBC driver that’s currently installed. How do you connect?
Choose the one below:
- CORBA
- JMS-JNI
- JDBC-ODBC bridge
- JDBC
79 . When would you choose RMI-JRMP over CORBA?
- When you are designing a pure Java solution
- When you are designing a solution that will not be pure Java but will mainly be in Java
- When you will interact with applications written in other languages such as C/C++
- When performance is essential
80 . You have a distributed system that is not made up entirely of Java objects (some of them are CORBA) what technology should you use?
Choose the one below:
- RMI-JRMP
- CORBA
- Rewrite the objects so the system in entirely Java based
- RMI-IIOP
81 . When would you use a JDBC-ODBC Bridge?
- This is the standard, and is used all the time
- When you have to use a database that has an ODBC driver but the JDBC driver doesn’t exist
- When you are connecting to a database running on a Windows server (NT, 2000 etc)
- When you need faster response times
82 . You have had enough with all the UML tools on the market as none do exactly what you want them to. So you’ve decided to design your own. However when designing it you realise that certain parts will be really complicated for example you have a Diagram object that is made up of lots of other objects. This diagram object can be used for a variety of different diagrams including class and sequence diagrams. When you create it you only want to specify its type and content?
What pattern should you use?
Choose the one below:
- Abstract Factory
- Factory Method
- Builder
- Decorator
83 . You need to interface with an existing application. You have full access to the source code and UML diagrams from the existing application. Part of the requirements implies that you will need to connect unrelated objects together. You want to know whether the Bridge pattern or the Adapter pattern will be suitable?
Which of the following are true about the Bridge and Adapter patterns?
Choose the one below:
- The Adapter pattern implements an interface known to its clients and provides an instance of a class not known to its clients
- The Bridge pattern implements an interface known to its clients and provides an instance of a class not known to its clients
- The Adapter pattern creates a separation between abstractions and classes that implement those abstractions
- The Bridge pattern creates a separation between abstractions and classes that implement those abstractions
84 . As part of your new application you need to create a custom class loader so that you can implement with custom security. So you need to create objects without knowing the class of the objects or how to create them?
What pattern should you use for this?
Choose the one below:
- Abstract factory
- Factory Method
- Builder
- Prototype
- Singleton
85 . You are creating a web application for an online product ordering system. You will be using data from several different databases and to reduce the load on the databases you have decided to use connection pooling. You have a ConnectionPool class and you want one pool for each database however you will have to connect to a variable number of databases?
What pattern should you use?
Choose the one below:
- Abstract factory
- Factory Method
- Builder
- Prototype
- Singleton
86 . You are interfacing with a server that is running as a JMS server and email server. Basically your company has an online shopping store and when a customer buys something you need to send an email confirmation. Email requests will be sent as JMS messages so as to reduce the load on the email server?
Does JMS provide the implementations to allow you to send these messages to the email server?
True/False?
Choose the one below:
- True
- False
87 . Is Point-to-Point (PTP) is based on message queues?
Choose the one below:
- TRUE
- FALSE
88 . Your have decided to let people shopping at your site receive confirmation emails when they buy online. The emails will not contain their credit card numbers but will contain the amount they have been charged. A JMS request to an email server will be used to do this?
However you are worried about how secure this will be but a college re-assures you that JMS has security built into it. Is this True?
True/False?
Choose the one below:
- True
- False
89 . You’ve designed an application that allows customers to buy chapters of e-books. Due to the success of the project this will be launched as a worldwide application?
In the process of converting this application to be suitable for worldwide use, which of the following will you use?
Choose the one below:
- Java runs with already as standard 16bit characters as standard so you don’t need to use any particular classes to change the text. All primitive objects can be used
- java.text package
- java.lang.Integer Class
- java.lang.Number Class
- java.international package
- java.Unicode package
90 . Which of the following are used in Internationalization?
- java.lang.Long Class
- java.lang.Float Class
- java.lang.Number Class
- java.lang.String class
- char primitive class
91 . What is the ResourceBundle class used for?
- To store information about the program, like an external configuration file
- To store parts of the program that is Locale sensitive, e.g. the text on a message window
- To get access to local system resources such as files etc
- To access properties of the users environment, language and a region
92 . You have been brought in from another project to help some colleagues with the documentation of an application they have been working on. You need to show groups of classes as subsystems?
What type of UML diagram will you use?
Choose the one below:
- Collaboration Diagram
- Class Diagram
- Package Diagram
- Use case Diagram
93 . What is true about the following diagram?
Choose the one below:
- Class A inherits from Class B
- Class B inherits from Class A
- Class B will send messages to Class A
- Class A will send message to Class B
94 . What is the “Something” shown in the following diagram?
Choose the one below:
- A component
- A package
- A component collaboration
- A super class
95 . What is true about the following diagram?
Choose the one below:
- It is a class called AName
- It is a static class called AName
- It is an object called AName
- It is an interface
96 . When should you use Java IDL and when should you use RMI-IIOP?
- You should use Java IDL when using Enterprise Javabeans
- You should use RMI-IIOP when using Enterprise Javabeans
- You HAVE to use RMI-IIOP when using Enterprise Javabeans
- Java IDL can be used even if the remote interfaces were originally defined as RMI interfaces
- RMI-IIOP can be used with CORBA only if the remote interfaces were originally defined as RMI interfaces
- RMI-IIOP can be used with CORBA even if not all of the remote interfaces were originally defined as RMI interfaces
- It comes down to programmer preference as both can be used in all situations
97 . You have an online shopping application that has been deployed for some time. Previously all sales had been diverted to another company. Because of the popularity of your site now, you have decided that your application will handle credit card sales, going forward. You will use JMS to send requests to charge credit cards to a separate server?
You need an instant response as to whether the credit card transaction was approved. What type of messaging do you use?
Choose the one below:
- Publish/Subscribe
- Point-to-Point
- Topic Messaging
- Instant Messaging
- You wouldn’t use messaging
98 . You are working for a company that aims to provide its customers with the facility to buy and sell shares online. You have been looking through the requirements document and notice that the process of selling/transferring shares is very complicated due to the constant price change. Hence you are required to control transactions at a very fine level of granularity?
Should you use CMT or BMT?
CMT = Container Managed Transaction
BMT = Bean Managed Transaction
Choose the one below:
- CMT
- BMT
99 . You have contracted by a company to assess an application currently deployed in production. The application meets all of the company’s original requirements and is coping well with the current number of users. The company is quite happy with it. It has been written using PERL and CGI scripts and there are no transactions in this system. What do you recommend they do?
Choose the one below:
- Migrate the solution to ASP based solution
- Migrate the solution to JSP and Servlets. In the future this will be more maintainable solution
- Keep it the way it is
- Migrate to JSP/Servlets and an Application server. In the future this will be more maintainable solution
100 . You have been contracted by a company to examine an existing system. It consists of PL/SQL stored procedures a JSP/Tomcat cluster of web servers and an Oracle database. The owners are saying that maintenance is their biggest problem, every time they try and change code they run into problems?
What do you recommend they do?
Choose the one below:
- Move the PL/SQL business logic into Servlets
- There shouldn’t be any problems with maintenance as the business logic has already been separated from the presentation and data store (PL/SQL stored procedures)
- Separate the business logic by using an Application Server
- Look through the code making sure it is structured well and commented, separating any duplicated code into a common class
101 . You have a method that can execute in a transaction as part of that transaction but it doesn’t matter if it doesn’t. What is the correct attribute in the deployment descriptor?
- Supports
- Not Supported
- Mandatory
- Required
- Leave is empty as this is the default setting
Answers
77 : 2 is correct.
Explanation:
ASP and JSP have a very similar syntax so it makes sense to replace ASP with JSP. You should also try and extract parts from the ASP script that perform controller operations or other processing and implement them as Servlets.Choice 1 is incorrect because the Java Message Service and has nothing to do with web pages. There is no mention of transactions in the questions and if there was it would probably be better to use EJBs as well so choice 3 is incorrect. Although choice 4 is possible this is not the best answer as there would be too much work involved in creating the Applets.
78 : 4 is correct.
Explanation:
The key to this question is that you don’t need to install a new ODBC driver or anything like that, you can connect to the database directly via JDBCCORBA is used for distributed systems not database connectivity so choice 1 is incorrect. Choice 2 wouldn’t work and choice 3 isn’t necessary, as the question doesn’t say that you can’t use a normal JDBC driver.
79 : 1 is correct.
Explanation:
The following is taken from:http://java.sun.com/j2se/1.3/docs/guide/idl/index.htmlThis is a fundamental question and it’s important to understand the distinction between these two ways of integrating the Java programming language with CORBA. Java IDL is for CORBA programmers who want to program in the Java programming language based on interfaces defined in CORBA Interface Definition Language (IDL). This is “business as usual” CORBA programming, supporting Java in exactly the same way as other languages like C++ or COBOL. RMI-IIOP (Remote Method Invocation over Internet Inter-ORB Protocol) is for Java programmers who want to program to the RMI interfaces, but use IIOP as the underlying transport. RMI-IIOP provides interoperability with other CORBA objects implemented in various languages – but only if all the remote interfaces are originally defined as Java RMI interfaces. It is of particular interest to programmers using Enterprise JavaBeans (EJB), since the remote object model for EJBs is RMI-based.You would use RMI-IIOP in choice 2. In choice 3 you would use CORBA. CORBA actually slightly outperforms RMI. Hence choice 4 is also incorrect.
80 : 2 is correct.
Explanation:
The following is taken from:http://java.sun.com/j2se/1.3/docs/guide/idl/jidlFAQ.htmThere are several scenarios that will define how you will want to create distributed CORBA applications. Here are some of them: Java IDL – If you have been developing CORBA applications using IDL for some time, you will probably want to stay in this environment. Create the interfaces using IDL, and define the client and server applications using the Java programming language to take advantage of its “Write Once, Run AnywhereTM” portability, its highly productive implementation environment, and its very robust platform. RMI-JRMP – If all of your applications are written in the Java programming language, you will probably want to use Java RMI to enable communication between Java objects on different virtual machines and different physical machines.
Using Java RMI without its IIOP option leverages its strengths of code portability, security, and garbage collection. RMI-IIOP – If you are writing most of your new applications using the Java programming language, but need to maintain legacy applications written in other programming languages as well, you will probably want to use Java RMI with its IIOP compiler option.RMI-JRMP would be used in an all Java solution so choice 1 is incorrect. There is no need to rewrite the objects so the system in entirely Java based so choice 3 is incorrect. There already are CORBA objects so although choice 4 is possible it is not the most appropriate answer.
81 : 2 is correct.
Explanation:
You are basically connecting to the ODBC driver as opposed to directly to the database.Choice 1 is incorrect; normally you would just connect directly via JDBC. Whether you are connecting to a database running on a Windows server (NT, 2000 etc) makes no difference at all. Hence choice 3 is incorrect. The JDBC-ODBC bridge will not increase performance as described in choice 4.
82 : 3 is correct.
Explanation:
The builder pattern separates the construction and representation of an object. The client is shielded from the objects construction only needing to specify it’s content and type.The Abstract Factory pattern is used for creating many objects that are dependent on each other. Hence choice 1 is incorrect. The Factory Method pattern provides an interface for creating an object that allows either sub classes or helper classes to create that object. Hence choice 2 is also incorrect. The Decorator pattern isn’t used to build objects. It adds extra functionality to existing objects. Hence choice 4 is incorrect.
83 : 1 & 4 is correct.
Explanation:
As the answers state the Adapter pattern implements an interface known to its clients and provides an instance of a class not known to its clients. And the Bridge pattern creates a separation between abstractions and classes that implement those abstractions. Choices 2 and 3 are incorrect because the descriptions are the other way around.
84 : 4 is correct.
Explanation:
This pattern is used to create new objects by copying its prototype.The Abstract factory pattern is used for creating many objects that are dependent on each other. Therefore choice 1 is incorrect. The Factory Method pattern provides an interface for creating an object defers creation to either sub classes or helper classes. Hence choice 2 is incorrect. The Builder pattern separates the construction and representation of an object. The client is shielded from the objects construction only needing to specify it’s content and type. Choice 3 is therefore incorrect. The Singleton pattern creates either one or a variable number of instances of a class making choice 5 incorrect.
85 : 5 is correct.
Explanation:
The Singleton doesn’t just create a single instance it can also be used to create a variable number of instances of a class.The Abstract factory pattern is used for creating many objects that are dependent on each other so choice 1 is incorrect. The Factory Method pattern provides an interface for creating an object defers creation to either sub classes or helper classes. Hence choice 2 is incorrect. The Builder pattern separates the construction and representation of an object. The client is shielded from the objects construction only needing to specify it’s content and type. Choice 3 is hence incorrect. The Prototype pattern is used to create new objects by copying its prototype. Choice 4 is therefore incorrect.
86 : 2 is correct.
Explanation:
The JMS only defines interfaces there are no implementation classes in the package. So you will need to write all of the implementations yourself.
87 : 1 is correct.
Explanation:
Point-to-Point messaging is typically used where a client application sends a message to another application. This is the one-to-one messaging paradigm. In contrast, Publish Subscribe, allows broadcast communication (one-to-many.)
88 : 2 is correct.
Explanation:
The JMS only defines interfaces so you will need to design your own security around this.
89 : 2 is correct.
Explanation:
The java.text package contains classes such as MessageFormat and NumberFormat, these classes are used to layout text in the appropriate way.Choice 1 is incorrect; primitive objects cannot be used. Choices 3 and 4 are incorrect because the way numbers are displayed is different in most countries. The packages named in choices 5 and 6 don’t exist.
90 : 4 & 5 is correct.
Explanation:
The String and char primitive classes are used in the process of Internationalization.Choices 1, 2 and 3 are all incorrect because its the way numbers are displayed that is different in most countries.
91 : 2 is correct.
Explanation:
A ResourceBundle is used to store all parts of a program that you will need to change as part of Internationalization. For example you could put the text for dialog messages there and when it came to displaying the dialog, the program will look up and retrieve the appropriate text based on the country of the user.Choice 1 is incorrect because the ResourceBundle doesn’t store any information about the program like an external configuration file. The ResourceBundle doesn’t give you any access to local resources. Hence choice 3 is incorrect. The properties of the user’s environment, language and a region are found in the users system properties, not the ResourceBundle. Hence choice 4 is also incorrect.
92 : 3 is correct.
Explanation:
A package diagram is used to show groups of classes that belong together. Choice 1 is incorrect because a Collaboration Diagram is a type of interaction diagram. A Class Diagram shows individual classes. Hence choice 2 is incorrect. A Use case Diagram depicts a scenario that the system would be involved in. Thus choice 4 is also incorrect.For more information about UML:http://www.uml.org/
93 : 2 is correct.
Explanation:
This diagram shows generalization (or inheritance). Note: Normally the sub class is be shown below the ancestor, though that is not a UML constraint.Choice 1 is incorrect because it is the other way around. Choices 3 and 4 are both incorrect because the empty triangle wouldn’t be there in the diagram if messages were being sent.For more information about UML:http://www.uml.org/
94 : 2 is correct.
Explanation:
This is a package and it represents a group of classes.The symbol is incorrect for it to be a component. Hence choice 1 is incorrect. For this to be part of a collaboration diagram it would need to interact with another object. Hence choice 3 is incorrect. If it were a super class, another class would need to extend from it. So choice 4 is also incorrect.For more information about UML:http://www.uml.org/
95 : 3 is correct.
Explanation:
You can tell this is an object because its name is underlined. The following is taken from (Cade 42):”If the element name is underlined, then it is an instance of an element. You can precede an element name with a : and have an anonymous instance. You can place a name in front of the : and have a named instance of an element.”Choices 1 and 2 are incorrect because the name is underlined. Choice 4 is incorrect because the symbol would have the word interface above it like this: <<interface>> if it were an interface.For more information about UML:http://www.uml.org/
96 : 2 & 5 is correct.
Explanation:
The following is taken from:http://java.sun.com/j2se/1.3/docs/guide/idl/index.htmlThis is a fundamental question and it’s important to understand the distinction between these two ways of integrating the Java programming language with CORBA. Java IDL is for CORBA programmers who want to program in the Java programming language based on interfaces defined in CORBA Interface Definition Language (IDL). This is “business as usual” CORBA programming, supporting Java in exactly the same way as other languages like C++ or COBOL. RMI-IIOP (Remote Method Invocation over Internet Inter-ORB Protocol) is for Java programmers who want to program to the RMI interfaces, but use IIOP as the underlying transport.
RMI-IIOP provides interoperability with other CORBA bjects implemented in various languages – but only if all the remote interfaces are originally defined as Java RMI interfaces. It is of particular interest to programmers using Enterprise JavaBeans (EJB), since the remote object model for EJBs is RMI-based. Choice 1 is incorrect; Java IDL has nothing to do with Enterprise Javabeans. In choice 3 you can use JRMP instead of IIOP if you want. So this choice is incorrect. Choice 4 is incorrect because Java IDL requires CORBA interfaces not RMI interfaces. Choice 6 is incorrect as all the interfaces must be defined as RMI interfaces. Choice 7 is incorrect because although sometimes Java-IDL and RMI-IIOP could be used for the same thing, generally a situation will suit one more than the other.
97 : 5 is correct.
Explanation:
If you need an instant response you probably wouldn’t use messaging. The idea of messaging is that you can send messages to other applications and let them process the messages in their own time. For this solution it will be better to use an EJB and directly query the credit card validation server.Choice 1 suggests that messages will be broadcast (one-to-many.) For credit card validations, there is no need to broadcast the request. Besides the question says that an”instant response is required.” Messaging is inherently asynchronous. Hence choice 1 is incorrect.Point-to-Point or P2P is a one-to-one messaging architecture. JMS does provide APIs that allow send-and-forget and send-and-respond messages. Though a synchronous request is mimicked here, messaging architecture, unlike RPC models, is not truly synchronous.
Note: In some P2P implementations (where a synchronous response is required using messaging), the sender puts the message in a queue. The receiver polls its queue and reads the message. The receiver then sends a response to another queue, which the sender is polling for responses and so on. So though the credit card validation can be achieved through P2P messaging, if a synchronous RPC call is available, that would be the preferred option.Topic Messaging is the same as Publish Subscribe. Hence choice 3 is incorrect. Instant Messaging refers to a method of chatting on the Internet. Hence choice 4 is incorrect.
98 : 2 is correct.
Explanation:
BMT gives you the developer much greater control over the transaction. As the developer, you can start the transaction where you want and end it where you want.CMT does however give you the advantage of not having to worry about code related to the transaction you can just focus on the business logic instead.The following is taken from: http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Transaction4.html
In a bean-managed transaction, the code in the session or message-driven bean explicitly marks the boundaries of the transaction. An entity bean cannot have bean-managed transactions; it must use container-managed transactions instead. Although beans with container-managed transactions require less coding, they have one limitation: When a method is executing, it can be associated with either a single transaction or no transaction at all. If this limitation will make coding your bean difficult, you should consider using bean-managed transactions.
99 : 3 is correct.
Explanation:
The key to this question is:The application meets all of the company’s original requirements and is coping with current number of users. The company is quite happy with it.There is no need to change an application that does everything it is supposed to do. Choice B is technically correct, JSP and Servlets will be more maintainable than PERL/CGI scripts but it is not the most appropriate answer. Choice 4 isn’t correct for the same reasons as choice 2, in addition to the fact that there appears to be no clear need for using an Application Server (there are no transactions and there is no mention of persistence requirements.) Choice 1 is also incorrect for the same reasons as choice 2.
100 : 3 is correct.
Explanation:
The key to this question is that the business logic has been implemented as PL/SQL stored procedures. This means there is a tight coupling between the data store and the business logic. This will have a direct affect on the maintenance of the application. To improve this the best thing to do would be move the business logic from the PL/SQL scripts to an Application Server and use Enterprise Beans. Another reason why this is the best choice is because they are already using JSP and Tomcat web servers. So the Application Server will integrate well into this solution. You could move the business logic into Servlets as suggested in choice 1 but this would create tight coupling between the business logic and presentation code. The application would still be hard to maintain, with problem areas at a different place. Choice 2 is incorrect as there is tight coupling between the data store and business logic. Even if the code is properly structured and commented there will still be tight coupling between the data stoe and business logic so choice 4 is incorrect.
101 : 1 is correct.
Explanation:
A method must support execution within a transactional scope, if it is to be executed as part of a transaction. The word ‘supports’ also implies that although it can be part of a transaction, it doesn’t have to. ‘Not Supported’ implies the method cannot be executed as part of a transaction. ‘Mandatory’ and ‘Required’ imply that the method must be executed as part of a transaction. Leaving the deployment descriptor empty is not the default setting for ‘supports.’