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
Can variables be used in java without initialization?
How big is a boolean?
What is Hierarchy of exception?
What are the different types of inner classes?
What is the difference between final, finally and finalize() in java?
Say any two properties in beans?
What is a treeset in java?
What a static class can contains?
What is size of int in java?
What do negative exponents mean?
Why singleton class is used in java?
Is java call by value?
How do you delete a list in java?
Can constructor return value?
Can each java object keep track of all the threads that want to exclusively access it?