wHAT IS DEFAULT SPECIFIER IN JAVA
wHAT IS DEFAULT CONSTRUCTOR IN JAVA
wHAT IS DEFAULT METHOD IN JAVA

Answer Posted / debasankar

DEFAULT SPECIFIER IN JAVA:
There are 4 types of accessibility specifier in java, they
are private,public,protected and default.
There is no key word in java to specify default specifier
When we do not specify any specifier which means default
specifier,

For Example :
public String getName(){...}
// here accessibility specifier is public

String getName(){...}
// here accessibility specifier is defalut, whose scope
is package-scope means this method is not accessible outside
the current package

DEFAULT CONSTRUCTOR IN JAVA:
Default constructor is the implicit constructor provided by
the compiler when we do not specify any constructor in our class
Default constructor looks like..
---------------------------------
<Access Modifier> <class_name>(){
super();// implicit super call
}

I have not heard about any default method in java..As far my
knowledge there is no default method till JAVA platform 1.4....

Is This Answer Correct ?    20 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between a choice and a list?

842


What is use of super keyword?

752


what is ststic with example

1807


What is the purpose of java?

769


How does enum work in java?

788


Can a abstract class be declared final?

788


Does string isempty check for null?

783


Is upper case in java?

743


Does A Class Inherit The Constructors Of Its Superclass?

777


Why wait and notify methods are declared in object class?

804


What are alternatives to java serialization?

820


What modifiers may be used with a top-level class?

798


What is the difference between int and integer in java?

784


What does this () mean in java?

757


How do you join strings in java?

760