Which of the following is true about packages?

A) Classes in the same package can access each other.

b) The inherited class should be in the same package as the parent class.

c) Package name a.b implies, package b is inherits from package a.

d) Package access is next to private access in being restrictive.

Questions by lalithakasiraj

Showing Answers 1 - 3 of 3 Answers

Amith

  • Feb 5th, 2013
 

I think your first option is true. But any how these things depends on access specifiers. If you are not specifying any access specifier default package level access will be applied to the classes, where each class can access classes in the package, In case of public access, it is like public access. No restrictions at all. Private is class level and protected in case of inheritance. Hope this will help you.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions