Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam 1z0-900 topic 1 question 11 discussion

Actual exam question from Oracle's 1z0-900
Question #: 11
Topic #: 1
[All 1z0-900 Questions]

Given the code fragment:

Which method should be used on line 3 to enable default validation mechanism?

  • A. u.setProperty(String, Object)
  • B. u.setProperty(Schema)
  • C. u.setEventHandler(ValidationEventHandler)
  • D. u.setAdapter(XmlAdapter)
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️
Reference:
https://docs.oracle.com/javaee/6/api/javax/xml/bind/Unmarshaller.html

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
orjava
3 months, 2 weeks ago
Answer C
upvoted 1 times
...
peteVln
4 months, 1 week ago
It seems that C is the correct answer. https://docs.oracle.com/javase/8/docs/api/javax/xml/bind/helpers/AbstractMarshallerImpl.html#setEventHandler-javax.xml.bind.ValidationEventHandler-
upvoted 1 times
...
kozionov
2 years, 4 months ago
There is no correct answer! Correct is setValidating(true) or setSchema(javax.xml.validation.Schema) because method setValidating(true) is deprecated. https://docs.oracle.com/javaee/7/api/javax/xml/bind/Unmarshaller.html#:~:text=By%20default%2C%20the%20Unmarshaller%20does,one%20of%20the%20unmarshal%20methods.
upvoted 2 times
...
ciellaf5
2 years, 7 months ago
Correct is C
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...