exam questions

Exam 1z0-811 All Questions

View all questions & answers for the 1z0-811 exam

Exam 1z0-811 topic 1 question 4 discussion

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

Which statement is true about a Java method?

  • A. It must be declared with an access modifier.
  • B. It cannot be defined within another method.
  • C. It must accept a parameter and return a value.
  • D. It cannot be defined as static final.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Eligi
6 months ago
A is not correct, because if no modifier is added to method, by default java will add 'protected' modifier. B is the correct answer.
upvoted 1 times
...
___Anu___
7 months, 2 weeks ago
Selected Answer: A
In Java, every method must be declared with an access modifier, which defines the visibility of the method. The access modifiers include public, private, protected, and package-private (default). The choice of access modifier determines where the method can be accessed from.
upvoted 1 times
...
supercoder
9 months, 1 week ago
Selected Answer: B
B is correct. will result in compile time error
upvoted 1 times
...
tabrezshaikh13
1 year ago
Selected Answer: B
B is the correct answer as we cannot have a method inside another method.
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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago