Can we access private data outside of the class directly in
java programming language? Why There is no runtime checking
in java, which leads to access the private data directly
outside of a class?

Answer Posted / chaitali

No,we cannot access private data outside of class in java.
There is only compile time checking and no runtime check in
java because Java supports concepts like Polymorphism and
reflection where on runtime certain decisions are taken

Is This Answer Correct ?    14 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we create an object of static class in java?

589


what is anonymous class in java?

536


Can final class have constructor?

490


Can we create more than one object singleton class?

571


Given a singly linked list, determine whether it contains a loop or not without using temporary space?

577






Why main method is called first in java?

537


How does enum work in java?

538


Can we force the garbage collection to run?

530


Implementations of set interface?

555


Explain when we should make an instance variable private.

599


What is an exception in java?

638


Can java cast null?

593


What are the elements of java?

547


What do the thread?class methods run() and start() do?

530


Why isn’t there operator overloading?

584