What is default specifier ??? Use of default specifier ???
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
How do you convert boolean to boolean?
Why is singleton not thread safe?
Package1 and Package2 both have a method name lets say "methodA" with different implementation. When I import both the packages in a java class how can I use both the methods?
What does t in java mean?
How can we make a class virtual?
What is variable in java?
What is difference between arraylist and list in java?
What is the minimum and maximum length of an identifier?
class A { class B { psvm(String args[]) { } } } if the prg saved in A.java whats the o/p?
Is null or empty java?
What is empty list in java?
what is the difference between thread and runnable types? : Java thread