What is default specifier ??? Use of default specifier ???

Answers were Sorted based on User's Feedback



What is default specifier ??? Use of default specifier ???..

Answer / hemanta paudel

Java provide a default access specifier which is apply when
programmer does not use other specifier.

The default specifier allow to access only with in the same
package. If class A and class B are in same package
(Mypackage) then class A can access class B and vice-verse.

class A
{
-----------
----------
---------
}

class B
{
A a=new A();
--------
--------
}

Is This Answer Correct ?    12 Yes 2 No

What is default specifier ??? Use of default specifier ???..

Answer / david sandyp

default is the access given to the class when no access specifier is mentioned ..

Default is not public but it is almost like public.

Is This Answer Correct ?    5 Yes 3 No

What is default specifier ??? Use of default specifier ???..

Answer / prativa mohapatra

Java provides a default specifier which is used when no
access modifier is present. Any class, field, method or
constructor that has no declared access modifier is
accessible only by classes in the same package. The default
modifier is not used for fields and methods within an
interface.

Is This Answer Correct ?    0 Yes 0 No

What is default specifier ??? Use of default specifier ???..

Answer / malli

default specifier:
with out mention any access specifier (private,
public,protect) is called default specifier.

ex://default// class Manager
{
}

use:

we can assign any default access specifier to particular
classes those classes we can use with in same package.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

Can you explain the private protected field modifier?

0 Answers  


what is real-time example of runtime polymorphism and compile time polymorphism

4 Answers   SLK Group,


Can I learn java in 3 months?

0 Answers  


What about features of local inner class?

0 Answers  


How can u increase the heap size in the memory?

0 Answers   Infosys,


Give a briefing on the life cycle of a thread.

1 Answers  


What is the difference between jsp and servlet?

6 Answers   Symphony,


What is a generic data type?

0 Answers  


What is type parameter in java?

0 Answers  


Difference between static binding and dynamic binding?

0 Answers  


How to run a JAR file through command prompt?

0 Answers  


what are the new features available in java 1.5 version?

3 Answers   Accenture, Features, Motorola,


Categories