Explore topic-wise MCQs in Technical Programming.

This section includes 1671 Mcqs, each offering curated multiple-choice questions to sharpen your Technical Programming knowledge and support exam preparation. Choose a topic below to get started.

101.

Which method is used to specify before any lines that uses the PrintWriter?

A. setPageType()
B. setContextType()
C. setContentType()
D. setResponseType()
Answer» D. setResponseType()
102.

RequestDispatcher object is used

A. to include other resources
B. to include an image
C. to include xml object
D. to include e-mailing response
Answer» B. to include an image
103.

Which EJB uses EJB-QL for query operations?

A. BMP Entity Bean
B. CMP Entity Bean
C. Session Bean
D. Message-Driven Bean
Answer» C. Session Bean
104.

When may a constructor be called without specifying arguments?

A. When the default constructor is not called
B. When the name of the constructor differs from that of the class
C. When there are no constructors for the class
D. None of above
Answer» D. None of above
105.

When a session bean has container-managed demarcation value of 'Supports', which three methods run in an unspecified transaction context? 1. ejbActivate 2. getRollbackOnly 3. getUserTransaction 4. ejbRemove 5. afterBegin 6. afterCompletion

A. 1,4,3
B. 4,2,6
C. 1,4,6
D. 2,5,6
Answer» D. 2,5,6
106.

The EJB Transaction Attribute that ensures the method call that always takes place in a transaction, either client started or container started’ are

A. TX_SUPPORTS
B. TX_MANDATORY
C. TX_REQUIRED and TX_REQUIRES_NEW
D. Either A or B
Answer» D. Either A or B
107.

Struts framework

A. should always decouple the application from a specific model implementation
B. provides model components
C. does not support JavaBeans and EJB
D. has built-in support for the model
Answer» B. provides model components
108.

Which of the following tags in struts-config.xml file defines the availability of necessary Struts JSP custom tag libraries?

A. < jsp-lib>
B. < struts-taglib>
C. < taglib>
D. < jsp-taglib>
Answer» D. < jsp-taglib>
109.

Which of the following acts as a bridge between user-invoked URI and a business method?

A. HttpRequest
B. Action class
C. ActionServlet
D. RequestProcessor
Answer» C. ActionServlet
110.

Business delegate pattern

A. Hides remote services complexity
B. Reduces coupling and increases manageability
C. Eases failure recovery
D. All of the above
Answer» E.
111.

What is the return type of program’s main( ) method?

A. Void main()
B. Init
C. Void
D. Run
Answer» D. Run
112.

Which services are provided to EJB components by the EJB container?

A. Transaction support
B. Persistence support
C. Naming support
D. All mentioned above
Answer» E.
113.

Which case of a session bean obtains the UserTransaction object via the EJBContext using the getUserTransaction() method in EJB transaction management?

A. Bean-managed transactions
B. Container-managed transactions
C. Both A & B
D. None of the above
Answer» B. Container-managed transactions
114.

Action Servlet, Request Processor and Action classes are the components of

A. View
B. Model
C. Deployment
D. Controller
Answer» C. Deployment
115.

How does Java Script store dates in objects of Date type?

A. The number of days since 1st, 1900
B. The number of seconds since January 1st, 1970
C. The number of milliseconds since January 1st, 1970
D. The number of picoseconds since January 1st, 1970
Answer» D. The number of picoseconds since January 1st, 1970
116.

How many instances can be created per application module by the Request Processor class?

A. Four
B. Three
C. One
D. Uncountable instances
Answer» D. Uncountable instances
117.

Which of the following is/are true for JSP technology? I. It is persistent. II. Platform independent. III. Browser executes the code.

A. Only (I) above
B. Only (II) above
C. Both (I) and (II) above
D. Both (II) and (III) above
Answer» D. Both (II) and (III) above
118.

What declarations are required for every Java application?

A. A class and the main( ) method declarations.
B. A class with void method
C. A class with main method
D. A class with init method
Answer» B. A class with void method
119.

What are identifiers and what is naming convention?

A. Identifiers are used for class names
B. Identifiers are used for class names, method names
C. Identifiers are used for class names, method names and variable names.
D. None of above
Answer» D. None of above
120.

What are default values of different primitive types?

A. int - 0
B. short - 0
C. byte - 0
D. long - 0 l
Answer» B. short - 0
121.

Which of the java bean tags is used to show the bean value on the web page?

A. < bean:define>
B. < bean:message>
C. < bean:show>
D. < bean:write>
Answer» E.
122.

Abbreviate the term JMS?

A. Java Message Service
B. Java Monitor Service
C. Java Message Session
D. Java Monitor Session
Answer» B. Java Monitor Service
123.

Which of the following statements correctly describes the relation between an object and the instance variable it stores?

A. Each new object has its own distinctive set of instance variables
B. Each object has a copy of the instance variables of its class
C. The instance variable of each object are separate from the variables of other objects
D. All of above
Answer» E.
124.

Which of the following is true for EJB?

A. EJB is server-side component architecture for distributed applications in Java
B. EJB facilitates scalable, secure and transaction-oriented applications
C. EJB supports portability and reusability
D. All of the above.
Answer» E.
125.

Which of the following is not a container for EJB? I. Internet Information Server. II. Java System Application Server. III. Tomcat. IV. WebLogic.

A. Both (I) and (II) above
B. Both (II) and (III) above
C. Both (III) and (IV) above
D. Both (I) and (III) above.
Answer» E.
126.

_________ are used to identify a user who returns to a Website.

A. Cookies
B. Plug-ins
C. Scripts
D. ASPs
Answer» B. Plug-ins
127.

In JSP Action tags which tags are used for bean development?

A. jsp:useBean
B. jsp:setPoperty
C. jsp:getProperty
D. All mentioned above
Answer» E.
128.

Which of the EJB has a passive state in its life cycle? I. Stateless Session Bean. II. Message-Driven Bean. III. BMP Entity Bean.

A. Only (I) above
B. Only (II) above
C. Only (III) above
D. Both (I) and (II) above
Answer» D. Both (I) and (II) above
129.

A message driven bean is like statefull session bean that encapsulates the business logicand doesn't maintain state.

A. True
B. False
C. none
D. all
Answer» C. none
130.

Which of the following is/are true for JSP technology?I. It is persistent. II. Platform independent. III. Browser executes the code.

A. Only (I) above
B. Only (II) above
C. Both (I) and (II) above
D. Both (II) and (III) above
Answer» D. Both (II) and (III) above
131.

Which two of the following is responsible to creates ejb-jar files? 1. The bean provider. 2. The application assembler. 3. The deployer. 4. The system administrator.

A. 1 and 2
B. 2 and 3
C. 3 and 4
D. 4 and 1
Answer» B. 2 and 3
132.

Which component does the Entity bean represents the persistent data stored in the database?

A. Server-side component
B. Client-side component
C. server and client side component
D. None of the above
Answer» B. Client-side component
133.

Which of the following below are abilities of Reflection API in Java?

A. Determining state of an object
B. Both B and C
C. Determining duplicate classes
D. Determination of the class of an object
Answer» E.
134.

EJB is a

A. Middleware
B. Scalable component architecture
C. Component architecture to integrate legacy systems
D. All of the above.
Answer» E.
135.

Which of the following are the session tracking techniques?

A. URL rewriting, using session object, using response object, using hidden fields
B. URL rewriting, using session object, using cookies, using hidden fields
C. URL rewriting, using servlet object, using response object, using cookies
D. URL rewriting, using request object, using response object, using session object
Answer» C. URL rewriting, using servlet object, using response object, using cookies
136.

In HTTP Request Which Asks for the loopback of the request message, for testing or troubleshooting?

A. PUT
B. OPTIONS
C. DELETE
D. TRACE
Answer» E.
137.

JMS is also known as a messaging service.

A. True
B. False
C. none
D. all
Answer» B. False
138.

From the following APIs, which API does NOT guarantee to be supported by EJB 2.0 containers?

A. JAXP
B. JNDI
C. JXTA
D. JDBC
Answer» D. JDBC
139.

To get the servlet environment information

A. ServletConfig object is used
B. ServletException object is used
C. ServletContext object is used
D. ServletContainer object is used
Answer» D. ServletContainer object is used
140.

What type of image map could be used with Java Script?

A. Client-side image maps
B. Server-side image maps.
C. Both A and B
D. Localhost image maps
Answer» B. Server-side image maps.
141.

Which of the following is not true for tag in JSP page?

A. Locates a bean instance
B. Stores object reference of the bean in a variable
C. Creates an instance if fails to locate the bean instance
D. All the above.
Answer» E.
142.

Which of the following statements accurately describe the use of access modifiers withina class definition?

A. They can be applied to both data & methods
B. They must precede a class's data variables or methods
C. They can appear in any order
D. All of above
Answer» E.
143.

What is the alternate name for Java script?

A. LimeScript
B. Both a and d
C. ECMScript
D. ECMAScript
Answer» E.
144.

Which two of the following must be included in every ejb-jar file? 1. Stubs for the EJBHome and EJBObject interface. 2. The JAR Manifest file. 3. A deployment descriptor. 4. The JNDI context. 5. The EJB's home interface.

A. 1 and 3
B. 2 and 5
C. 3 and 5
D. 4 and 2
Answer» D. 4 and 2
145.

In EJB, middleware services are provided by EJB Container automatically.

A. True
B. False
C. none
D. all
Answer» B. False
146.

In order for a source code file, containing the public class Test, to successfully compile, which of the following must be true?

A. It must have a package statement
B. It must be named Test.java
C. It must import java.lang
D. It must declare a public class named Test
Answer» C. It must import java.lang
147.

Which of the following features are common to both Java & C++?

A. The class declaration
B. The access modifiers
C. The encapsulation of data & methods with in objects
D. All of above
Answer» E.
148.

Which of the following is not an implicit object in JSP? I. Request. II. Session. III. Vector. IV. In.

A. Both (I) and (II) above
B. Both (II) and (III) above
C. Both (I) and (III) above
D. Both (III) and (IV) above.
Answer» E.
149.

Which of the following is not a container for EJB?I. Internet Information Server. II. Java System Application Server. III. Tomcat. IV. WebLogic.

A. Both (I) and (II) above
B. Both (II) and (III) above
C. Both (III) and (IV) above
D. Both (I) and (III) above.
Answer» E.
150.

Which of the following allows substitution of code to occur at the translation time in a JSP page?

A. <jsp:include> Tag
B. <@ include> directive
C. <@ page> directive
D. Declaration block
Answer» C. <@ page> directive