Explain the difference between public and protected access specifier?

1 answer

Answer

1211587

2026-08-08 15:25

+ Follow

A private variable is only accessible in the class where it was declared

A protected variable is accessible to sub classes and classes in the same package as where they were declared

ReportLike(0ShareFavorite

Related Questions

Copyright © 2026 eLLeNow.com All Rights Reserved.