How to access a variable if it is declared as private?

Answer Posted / neo

You can access the private variable in to the other package
or other classes by inheritance . to inherite the super
classes all the resources comes in to sub classes private
also in this context.

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are different types of inner classes ?

804


What is incompatible types in java?

824


What does the “final” keyword mean in front of a variable? A method? A class?

799


What is the difference between hashmap and hashtable? What is an interface?

821


What is meant by call by reference?

765


Explain java code for recursive solution's base case?

809


Explain the difference between string, stringbuffer and stringbuilder in java?

792


what is inner class in java?

880


Explain method overloading?

791


How to solve the problem of generating the unique hash keys with hash function?

1699


What are loops in java?

840


Why java is call by value?

807


Is there any way to skip finally block of exception even if some exception occurs in the exception block?

869


Which number is denoted by leading 0x or 0x in java?

845


What is the difference between iterator and list iterator?

767