How can a class be accessed, If no access modifiers are
declared?

Answers were Sorted based on User's Feedback



How can a class be accessed, If no access modifiers are declared?..

Answer / banti

If a there is no access modifier specified to a class it
takes the access modifier as Default. This means the class
which has Default Access modifier can be accessed from
other classes defined in the same package.

Is This Answer Correct ?    2 Yes 0 No

How can a class be accessed, If no access modifiers are declared?..

Answer / ranganathkini

If a class is marked with no access modifiers then it is
given "package" access by default which means it can be
instantiated or subclasses by other classes in the same
package but it is inaccessible to classes outside the same
package.

Is This Answer Correct ?    0 Yes 0 No

How can a class be accessed, If no access modifiers are declared?..

Answer / ravikiran(aptech mumbai)

the default access will be resticted to the classes with in
the same package

Is This Answer Correct ?    0 Yes 0 No

How can a class be accessed, If no access modifiers are declared?..

Answer / babu

If a there is no access modifier specified to a class then it
takes the access modifier as Default modifier.Default Access modifier scope is package scope.so this class scope also package scope to access the classes which is having in the same package.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is finally block?

0 Answers  


Is empty set an element of empty set?

0 Answers  


Which api is provided by java for operations on set of objects?

0 Answers  


Why we do exception handling in java and how many types of exceptions are there?

0 Answers  


Is singleton thread safe in java?

0 Answers  






What is garbage collection? What is the process that is responsible for doing that in java?

0 Answers  


what is server side caching?

0 Answers   AIG,


Explain the purpose of garbage collection in Java?

0 Answers   BirlaSoft,


What are the methods used to implement for the key object in the hash map?

0 Answers  


What is a default constraint?

0 Answers   HCL,


What do you mean by stack?

0 Answers   Accenture,


how u do unit testing?

2 Answers   iFlex,


Categories