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
what is the significance of listiterator in java?
Why parsing is done?
What is meant by anonymous class?
Is {a, n, d} a palindrome? If you are given a random string, is it a palindrome or not?
What is the purpose of format function?
How do you escape a string?
What is java and why do we need it? Explain
Does list maintain insertion order java?
Does java allow default arguments?
What is meant by string is immutable?
Implement two stacks using a single array.
Differences between external iteration and internal iteration?
What are 4 pillers of object orinted programming?
How do you implement singleton class?
What is unicode datatype?