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 do you know about the garbate collector?

0 Answers  


How to convert String into primitive datatype.

6 Answers  


Can we define a package statement after the import statement in java?

0 Answers  


How to declare an arraylist in java?

0 Answers  


What is a data structure java?

0 Answers  


Explain Event handling in AWT?

1 Answers   Infosys, TCS,


What is meant by Java ?

2 Answers   CMC, Infosys,


what is difference between perfom() & excute() ?

2 Answers   IBM,


In C we use only compiler. Why java uses both compiler and interpreter? What is its significance?

5 Answers  


Can interface be private in java?

0 Answers  


What is var keyword ?

0 Answers   Wipro,


What do you understand by the term wrapper classes?

0 Answers  


Categories