Red Hat Certified Enterprise Application Developer Exam, Exams of Technology

This certification validates a developer's ability to create, test, deploy, and maintain enterprise-level applications using Red Hat JBoss Enterprise Application Platform and related tools. It tests proficiency in Java EE APIs (JPA, CDI, JAX-RS, EJB), RESTful services, and containerized deployments. Ideal for developers working in enterprise environments.

Typology: Exams

2024/2025

Available from 07/26/2025

BookVenture
BookVenture šŸ‡®šŸ‡³

3.2

(20)

26K documents

1 / 82

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Red Hat Certified Enterprise Application Developer
Exam
Question 1. Which Java keyword is used to declare a class as a Stateless Session Bean in EJB?
A) @Stateless
B) @Entity
C) @ManagedBean
D) @EJB
Answer: A) @Stateless
Explanation: The @Stateless annotation explicitly marks a class as a Stateless Session Bean, indicating
that it does not maintain any conversational state with clients between method calls.
Question 2. In JAX-RS, which annotation is used to specify the URI path segment for a resource class?
A) @Path
B) @Resource
C) @Uri
D) @Endpoint
Answer: A) @Path
Explanation: The @Path annotation is used to specify the relative URI path for a resource class or
method in JAX-RS, enabling RESTful URL mapping.
Question 3. Which Java collection implementation guarantees insertion order?
A) HashSet
B) TreeSet
C) LinkedHashMap
D) PriorityQueue
Answer: C) LinkedHashMap
Explanation: LinkedHashMap maintains the order of insertion, preserving the sequence in which entries
are added, unlike HashMap.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52

Partial preview of the text

Download Red Hat Certified Enterprise Application Developer Exam and more Exams Technology in PDF only on Docsity!

Exam

Question 1. Which Java keyword is used to declare a class as a Stateless Session Bean in EJB? A) @Stateless B) @Entity C) @ManagedBean D) @EJB Answer: A) @Stateless Explanation: The @Stateless annotation explicitly marks a class as a Stateless Session Bean, indicating that it does not maintain any conversational state with clients between method calls. Question 2. In JAX-RS, which annotation is used to specify the URI path segment for a resource class? A) @Path B) @Resource C) @Uri D) @Endpoint Answer: A) @Path Explanation: The @Path annotation is used to specify the relative URI path for a resource class or method in JAX-RS, enabling RESTful URL mapping. Question 3. Which Java collection implementation guarantees insertion order? A) HashSet B) TreeSet C) LinkedHashMap D) PriorityQueue Answer: C) LinkedHashMap Explanation: LinkedHashMap maintains the order of insertion, preserving the sequence in which entries are added, unlike HashMap.

Exam

Question 4. Which JPA annotation is used to specify the primary key of an entity? A) @Id B) @PrimaryKey C) @GeneratedValue D) @Column Answer: A) @Id Explanation: The @Id annotation marks a field as the primary key of a JPA entity, uniquely identifying each record in the database. Question 5. Which scope annotation in CDI indicates that a bean is created once per HTTP request? A) @ApplicationScoped B) @RequestScoped C) @SessionScoped D) @Dependent Answer: B) @RequestScoped Explanation: @RequestScoped indicates that a bean's lifecycle is tied to a single HTTP request, and a new instance is created for each request. Question 6. Which JAX-RS annotation is used to specify that a resource method produces JSON media type? A) @Consumes(MediaType.APPLICATION_JSON) B) @Produces(MediaType.APPLICATION_JSON) C) @Produces(MediaType.TEXT_PLAIN) D) @ResponseType Answer: B) @Produces(MediaType.APPLICATION_JSON)

Exam

Answer: A) @PathParam Explanation: @PathParam binds a method parameter to a URI template variable in the resource URI. Question 10. Which Java interface is implemented to create an asynchronous message consumer in JMS? A) MessageProducer B) MessageListener C) MessageReceiver D) MessageHandler Answer: B) MessageListener Explanation: Implementing the MessageListener interface allows a JMS client to asynchronously receive messages by defining the onMessage() method. Question 11. Which annotation in Bean Validation API is used to ensure a string field is not null and has a minimum length? A) @NotNull, @Size(min=) B) @NotEmpty, @Min C) @Required, @Length D) @Present, @MinSize Answer: A) @NotNull, @Size(min=) Explanation: @NotNull ensures the value isn't null, and @Size(min=) enforces minimum length constraints on strings or collections. Question 12. Which annotation in JPA is used to specify a one-to-many relationship between entities? A) @ManyToOne B) @OneToMany C) @ManyToMany D) @OneToOne

Exam

Answer: B) @OneToMany Explanation: @OneToMany defines a one-to-many relationship, indicating that one entity instance relates to many instances of another entity. Question 13. In CDI, which annotation is used to produce a custom object for dependency injection? A) @Inject B) @Produces C) @Qualifier D) @Disposes Answer: B) @Produces Explanation: @Produces marks a producer method or field that creates objects to be injected elsewhere. Question 14. Which JAX-RS annotation is used to handle HTTP DELETE requests? A) @GET B) @POST C) @PUT D) @DELETE Answer: D) @DELETE Explanation: @DELETE annotation maps a method to handle HTTP DELETE requests, typically used for resource removal. Question 15. Which Java class is used in JPA to execute JPQL queries? A) QueryBuilder B) Query C) EntityManager

Exam

C) @Consumes(MediaType.TEXT_PLAIN) D) @Produces(MediaType.XML) Answer: B) @Produces(MediaType.TEXT_PLAIN) Explanation: @Produces(MediaType.TEXT_PLAIN) specifies that the method produces plain text responses. Question 19. Which method in JMS API is used to create a message producer? A) createConsumer() B) createProducer() C) createSender() D) createPublisher() Answer: B) createProducer() Explanation: createProducer() is used to create a MessageProducer that sends messages to destinations. Question 20. In Bean Validation, which annotation is used to validate that a number is within a specified range? A) @Range B) @Min and @Max C) @Between D) @Size Answer: B) @Min and @Max Explanation: @Min and @Max set lower and upper bounds for numeric values, enabling range validation. Question 21. Which JPA annotation is used to specify that a property should be ignored by persistence? A) @Transient

Exam

B) @Ignore C) @TransientProperty D) @Skip Answer: A) @Transient Explanation: @Transient marks a property to be ignored by the persistence provider, and it won't be stored in the database. Question 22. Which annotation in CDI is used to qualify dependency injection to resolve ambiguity? A) @Qualifier B) @InjectQualifier C) @Named D) @QualifierAnnotation Answer: A) @Qualifier Explanation: The @Qualifier annotation is used to create custom qualifiers for distinguishing between multiple bean implementations. Question 23. Which Java class in JPA is used to create dynamic criteria queries? A) CriteriaBuilder B) CriteriaQuery C) CriteriaBuilderFactory D) CriteriaResolver Answer: A) CriteriaBuilder Explanation: CriteriaBuilder creates criteria queries in a type-safe manner, enabling dynamic query construction. Question 24. In JAX-RS, which annotation is used to extract a query parameter value?

Exam

Question 27. In CDI, which scope annotation indicates that a bean is created once per application lifecycle? A) @Dependent B) @RequestScoped C) @ApplicationScoped D) @SessionScoped Answer: C) @ApplicationScoped Explanation: @ApplicationScoped indicates a singleton bean shared across all users and sessions during the application's lifetime. Question 28. Which JPA annotation is used to specify a named query? A) @NamedQuery B) @Query C) @Named D) @QueryName Answer: A) @NamedQuery Explanation: @NamedQuery defines a static, reusable query with a name, which can be invoked via EntityManager. Question 29. Which method in EntityManager is used to find an entity by its primary key? A) find() B) get() C) retrieve() D) load() Answer: A) find() Explanation: find() retrieves an entity instance by its primary key, returning null if not found.

Exam

Question 30. What is the purpose of the @Temporal annotation in JPA? A) To specify temporal data types for date/time fields B) To mark a field as transient C) To specify that a field is calculated at runtime D) To define the temporal order of entity persistence Answer: A) To specify temporal data types for date/time fields Explanation: @Temporal indicates whether a java.util.Date or java.util.Calendar should be stored as DATE, TIME, or TIMESTAMP in the database. Question 31. Which annotation in JAX-RS is used to specify that a method handles HTTP PUT requests? A) @GET B) @POST C) @PUT D) @DELETE Answer: C) @PUT Explanation: The @PUT annotation maps a method to handle HTTP PUT requests, generally used for updating resources. Question 32. Which collection class in Java guarantees thread safety when accessed concurrently without external synchronization? A) ArrayList B) ConcurrentHashMap C) CopyOnWriteArrayList D) HashSet

Exam

D) @SessionScoped Answer: A) @ApplicationScoped Explanation: @ApplicationScoped indicates a singleton bean shared across the entire application. Question 36. Which Java interface is used as a marker for a class that can be serialized? A) Cloneable B) Serializable C) Externalizable D) SerializableObject Answer: B) Serializable Explanation: Implementing Serializable marks a class as capable of being serialized, enabling object state persistence. Question 37. Which JAX-RS annotation is used to specify that a method produces XML content? A) @Produces(MediaType.APPLICATION_JSON) B) @Produces(MediaType.APPLICATION_XML) C) @Consumes(MediaType.APPLICATION_XML) D) @Produces(MediaType.TEXT_PLAIN) Answer: B) @Produces(MediaType.APPLICATION_XML) Explanation: @Produces(MediaType.APPLICATION_XML) indicates the method outputs XML formatted data. Question 38. In JMS, which interface is used to create messages? A) MessageListener B) MessageProducer C) Message

Exam

D) MessageFactory Answer: C) Message Explanation: Message is the base interface representing a JMS message; factories like Session.createMessage() create instances. Question 39. Which annotation in JPA indicates a generated value for primary key? A) @Id B) @GeneratedValue C) @Column D) @SequenceGenerator Answer: B) @GeneratedValue Explanation: @GeneratedValue specifies that the primary key value should be generated automatically, typically via a sequence or identity. Question 40. Which Java EE annotation can be used to inject a resource such as DataSource or JMS connection factory? A) @Inject B) @Resource C) @Autowired D) @InjectResource Answer: B) @Resource Explanation: @Resource is used in Java EE to perform resource injection, such as DataSources or JMS factories. Question 41. Which annotation in Bean Validation API is used to validate that a string matches a regular expression? A) @Pattern

Exam

C) @PUT

D) @DELETE

Answer: B) @POST Explanation: @POST maps a method to handle HTTP POST requests, typically for creating resources. Question 45. In JMS, what is the primary purpose of a Message-Driven Bean (MDB)? A) To send messages synchronously B) To receive messages asynchronously C) To store messages in a database D) To process messages in a batch Answer: B) To receive messages asynchronously Explanation: MDBs are designed to asynchronously consume messages from JMS destinations like queues or topics. Question 46. Which annotation in JPA is used to specify the database table name for an entity? A) @Table B) @Entity C) @Column D) @Schema Answer: A) @Table Explanation: @Table specifies the exact table name associated with an entity class. Question 47. Which Java class provides the main API to execute JPQL queries? A) EntityManager B) SessionFactory C) EntityTransaction

Exam

D) QueryBuilder Answer: A) EntityManager Explanation: EntityManager provides methods like createQuery() for executing JPQL queries. Question 48. In CDI, which annotation marks a bean as the default implementation for dependency injection? A) @Default B) @Named C) @Inject D) @Qualifier Answer: A) @Default Explanation: @Default is the implicit qualifier, making a bean the default candidate when no other qualifiers are specified. Question 49. Which annotation in JAX-RS is used to specify that a method consumes form data? A) @Consumes(MediaType.APPLICATION_FORM_URLENCODED) B) @Consumes(MediaType.APPLICATION_JSON) C) @Consumes(MediaType.TEXT_PLAIN) D) @FormParam Answer: A) @Consumes(MediaType.APPLICATION_FORM_URLENCODED) Explanation: The annotation specifies that the method can accept URL-encoded form data. Question 50. Which JMS API interface is used to create and send messages? A) MessageProducer B) MessageConsumer C) Message

Exam

C) @TransientField D) @Skip Answer: A) @Transient Explanation: @Transient indicates that a field should not be persisted in the database. Question 54. In JAX-RS, which annotation binds a method parameter to a header value? A) @HeaderParam B) @Header C) @HeaderField D) @HeaderValue Answer: A) @HeaderParam Explanation: @HeaderParam retrieves the value of a specific HTTP header. Question 55. In JMS, which interface defines the way to receive messages asynchronously? A) MessageListener B) MessageConsumer C) MessageProducer D) MessageFactory Answer: A) MessageListener Explanation: Implementing MessageListener allows for asynchronous message consumption. Question 56. Which Java EE annotation secures a resource method to users with specific roles? A) @RolesAllowed B) @PermitAll C) @DenyAll

Exam

D) @Roles Answer: A) @RolesAllowed Explanation: @RolesAllowed restricts access to users belonging to specified roles. Question 57. Which annotation in JPA is used to specify a one-to-one relationship? A) @OneToOne B) @ManyToOne C) @OneToMany D) @ManyToMany Answer: A) @OneToOne Explanation: @OneToOne defines a one-to-one association between entities. Question 58. Which CDI annotation is used to mark an event observer method? A) @Observes B) @EventListener C) @Observer D) @Notify Answer: A) @Observes Explanation: @Observes marks a method parameter as an observer for CDI events. Question 59. Which annotation specifies the media types that a JAX-RS resource method can consume? A) @Produces B) @Consumes C) @ProducesMediaType D) @ContentType