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 are internal and external variables?

539


What do you understand by weak reference?

550


What is hash table in java?

491


How do you identify if jvm is 32-bit or 64-bit from java program?

534


How do you find the absolute value?

557






Does java isempty check for null?

565


Is java still necessary?

617


Do I need java on my computer?

524


What is google full form?

532


How will you add panel to a frame?

640


What is a short in java?

494


What is type safety in java?

480


how can you catch multiple exceptions in java?

540


What is a byte string?

615


What is meant by method?

575