C++ and J2EE Programming Concepts
Quiz covering advanced C++ OOP concepts (constructors, templates, overloading, access levels) and J2EE enterprise development (multitiered applications, beans, containers, XML)
Questions
What is a J2EE component?
- Special icons for creating the user interface elements for thin clients
- A data module saved to the component area of the database.
- A self-contained functional software unit that is assembled into a J2ee application and interfaces with other application components
- A JAR file
What advantage does a entity-bean have over a session bean?
- Entity-bean data survives crashes.
- An entity-bean represents non-persistent data.
- It creates its own JAR file during deployment
- You get authentication code without having to write any.
When do you use a session bean?
- When you want to be certain your application data persists between program invocations , even in the event of a crash
- If you need to initiate a database transaction
- To process transient data that can be re-created in the event of a crash.
- to keep people who do not know how to program , from accidentally changing important logic code.
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?
- To make the user interface more interesting.
- To simplify application deployment.
- To prevent malicious programs from gaining access to sensitive information on your database server.
- To make the application much easier to update, maintain, and manage
Why is XML a good way to transfer text-based data from one program or tool to another?
- XML imposes important limitations on the receiving program or tool.
- The receiving program or tool can use the XML tagging information to determine how to best handle the incoming data
- XML tags offer an extra level of security.
- XML tags specify to the receiving program or tool exactly how to format and display the data.
What part of the J2EE platform handles data storage and retrieval on behalf of a container-managed entity bean?
- The thin client.
- Deployment descriptors
- The JAR file.
- The bean's container
What is bean-managed persistence?
- When you implement entity or session bean methods to use SQL commands you provide
- When the bean's container handles data storage and retrieval.
- When the J2EE server is never shut down.
- When changes to database data are lost during a crash
How are life cycle methods called?
- By thin clients.
- By calls to the database
- By the J2EE server.
- By the bean's container.
In a multitiered application, which tier is the browser in?
- First tier.
- Second tier.
- Third tier.
- Fourth tier.
Inline functions are invoked at the time of
- Run time
- Compile time
- Depends on how it is invoked
- Both b and c
Which of the following operators below allow to define the member functions of a class outside the class?
- ::
- ?
- :?
- %
Every class has at least one constructor function, even when none is declared.
- True
- False
Can constructors be overloaded?
- True
- False
An abstract class can be instantiated.
- True
- False
The default access level assigned to members of a class is ___________
- Public
- Protected
- Private
- Default
What is the difference between overloaded functions and overridden functions?
- Overloading is a dynamic or run-time binding and Overriding is static or compile-time binding
- Redefining a function in a friend class is called function overriding while Redefining a function in a derived class is called a overloaded fucntion.
- Overloading is a static or compile-time binding and Overriding is dynamic or run-time binding
- Redefining a function in a friend class is called function overloading while Redefining a function in a derived class is called as overridden fucnion.
Which of the following library function below by default aborts the program?
- Terminate()
- end()
- abort()
- exit()
What defines a general set of operations that will be applied to various types of data?
- Template class
- Function template
- Class template
- Both a and c
What happens when a pointer is deleted twice?
- It can abort the program
- It can cause a failure
- It can cause an error
- It can cause a trap
There is nothing like a virtual constructor of a class.
- True
- False