What modifiers may be used with an inner class that is a member of an outer class

A (non-local) inner class may be declared as public, protected, private, static, final, orabstract.

Showing Answers 1 - 13 of 13 Answers

shashank

  • Jul 25th, 2005
 

Any Vector methods acsess which operate on data is Synchronized.

  Was this answer useful?  Yes

trinadh

  • Mar 19th, 2008
 

A non-static member class means inner class is a member of an enclosing class, it can have any accessiblity:public,default,protected, or private.

  Was this answer useful?  Yes

An inner class is a full pledged member of the enclosing class (outer class), so it can be marked with any access modifier including abstract or final modifiers(neer both abstract and final together). But an inner class cannot contain any static members (else compiler will throw an errror)

priyam

  • Oct 14th, 2022
 

It can have any access modifiers public ,private,protected,default like any ordinary top level class.

  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