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 / puneet

This is a compile time activities, the scopes and the access
issues are handled at the compile time and this exception is
not the subclas of the runtime exception class and doesnt go
unchecked during compile time, they are checked at compile
time and the compile time exceptions are checked exceptions
which are checked by the compiler before hand and the
example of runtime exception is say bad logic like array
having -ve size and division by zero where actual excecution
occurs in JRE of the byte code.

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are 3 data types?

549


Explain access specifiers?

661


Give any two differences between C++ and java.

562


What is a protected class in java?

544


What is flag in java?

537






What does void * mean?

537


What is string english?

547


What are disadvantages of java?

525


What is a priority queue java?

530


What is an i/o filter?

571


Why there are some null interface in JAVA? What does it mean? Give some null interface in JAVA?

623


What is an example of a boolean?

574


Explain working of call by reference function invoking.

594


What is a jit compiler?

640


What is externalizable interface?

584