An erratum to my previous comment, the correct one is BD
- B: m3 is protected, but can be accessed if the other class extends the parent class even though it is in a different package.
- D: m1 is public, just by importing the package you can access it normally.
BD corect .AC not because as , you can not override the private method in Java because it's bonded during compile time using static binding. It's also not visible on sub-class so cannot be overridden but you can hide the method by declaring another private method of the same signature
The correct answer is AB, talking about overloading and it has 4 methods that have 4 different types of visibility, following this logic, the ones that have less visibility are the AB responses, remember that when a method does not come with its declared visibility, java sets visibility to "default" by default which is more restricted than private.
Private methods can not be overridden so answer is wrong
Answers should be BD
upvoted 3 times
...
Log in to ExamTopics
Sign in:
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.
iSnover
Highly Voted 2 years, 2 months agoMPignaProTech
Most Recent 2 months, 2 weeks agotawa_z58
1 year, 11 months agoRajeevkuamr
1 year, 12 months agoiSnover
2 years, 3 months agoshivkumarx
2 years, 4 months ago