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

When we r go to abstract class and when we go to Interface? i have confusion this question while in interview plz clarify

3 Answers   HCL, Photon,


Explain restrictions on using enum?

0 Answers  


What is the difference between member variables initialization and assignment in a constructor?

0 Answers   Hexaware, Virtusa,


Hai friends I am MCA 2006 passout. Spend time in 1 yr for teacing and 5 months in small s/w firm. worked in 4 or 5 months in few places. Presently I am writing bank exams. I want to get back to IT sector. Are there any possibilities. any growth prospects?. I am having some knowledge in core and advanced java. I am so desperate. Any suggestions thanks in advance. u can write to my mail mahidestiny@gmail.com

4 Answers  


How to find the index of the largest number in an arraylist java?

0 Answers  






Howmany classes that package java.applet.* contains?

1 Answers   TCS,


What does jenkins do?

0 Answers  


What do you mean by an object in java?

0 Answers  


finalize() method?

5 Answers  


Can we sort a map in java?

0 Answers  


In a program, initializing an array of 100 KB is throwing an out of memory exception while there is 100 MB of memory available. Why?

0 Answers   MCN Solutions,


Can we serialize singleton class?

0 Answers  


Categories