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

How do you add an element to a set in java?

492


What is an array in java?

635


What are invisible components?.

1673


How do you use nextline in java?

499


What is the difference between == and === javascript?

564






What does the string method compareto () do?

535


Difference between final and effectively final ?

626


What access modifiers can be used for methods?

553


Explain the difference between a Thread and a Process.

556


What is singleton pattern?

548


What is meant by JVM? Is JVM platform independent or not?

569


Is final static java?

540


What is floating data type?

531


When object is created and destroyed?

634


What is the different types of functions?

551