This content has been marked as final. Show 3 replies
EJP wrote:Can you give an example...Also in future classC will also use methods of classB
So how do i accomplish this? What is the Access Specifier i need to use?There are no access specifiers in Java, only access modifiers. Put class B inside class A, possibly as static, and make it and its methods private.
Can you give an example.I don't consider any example necessary. Any competent programmer should be able to carry out those instructions without further assistance.
Also in future classC will also use methods of classBThen you should have said so in the first place, and the solution I suggested doesn't apply. You will have to put class B into its own file, with no access modifiers t all on its class declaration rom,ethics. That way it is only visible to members of the same package.
Again, no example necessary.