Exam 1Z0-829 Topic 1 Question 33 Discussion
Actual exam question for Oracle's 1Z0-829 exam
Question #: 33
Topic #: 1
Question #: 33
Topic #: 1
Given the code fragment:

Which action enables the code to compile?

Which action enables the code to compile?
Suggested Answer: E Vote an answer
The code will compile if the regNo variable is made public. This is because the regNo variable is being accessed in the main method of the App class, which is outside the scope of the Product class. Making the regNo variable public will allow it to be accessed from outside the class. Reference: https://education.oracle.com/products/trackp_OCPJSE17, https://mylearn.oracle.com/ou/learning-path/java-se-17-developer/99487, https://docs.oracle.com/javase/tutorial/java/javaOO/accesscontrol.html
by Duncan at Jan 24, 2025, 02:38 AM
0
0
0
10
Comments
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.
Report Comment
Commenting
You can sign-up / login (it's free).