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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why does java have different data types for integers and floating-point values?

540


What is classname class in java?

539


What is the difference between this() and super() in java?

545


What is the instance of an object?

559


What is a key in java?

505






Do I need java on my computer?

530


How do generics work in java?

524


What is a two-pass assembler?

611


Can I use % with real numbers?

568


When is the arraystoreexception thrown?

574


What’s the difference between constructors and other methods?

536


What is the main advantage of passing argument by reference?

507


Why do we need hashmap in java?

564


What is a get method?

539


Explain the public class modifier?

507