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
If try block is successfully executed, Then Is Finally block executed?
What does opcode mean?
Why char array is favored over string for the storage of passwords?
Explain why wait(), notify() and notifyall() methods are in object class rather than in the reading class?
What is string made of?
What will be the output of round(3.7) and ceil(3.7)?
What are adapter classes?
Is a boolean 1 bit?
How many types of equations are there?
What is anti pattern in cyber security?
Explain the selection sort algorithm?
Find the value of a specified element of the array arr[i] where 0 <= i <= n-1
Can a class have a static inner class?
What is Gang of four design patterns
Can we declare register variable as global?