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
What is main string [] args?
What is the definition of tree ?
What is the argument in java?
What is finalize method?
What is garbage collection? What is the process that is responsible for doing that in java?
What is regex in java?
What does the “final” keyword mean in front of a variable? A method? A class?
What happens when a thrown exception is not handled?
What is a treemap in java?
What does yield method of the thread class do?
Can you explain the final method modifier?
You can create a string object as string str = “abc”; why cant a button object be created as button bt = “abc”;? Explain
Make a data structure and implement an algorithm to print all the files in a directory. (The root directory can have sub-directories too.)
What is the difference between Java Program Constructor and Java Program Method, What is the purpose of Java Program constructor Please Explain it Breafily?
Can a class be private in java?