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 are the types of arrays in java?
Which are the two subclasses under exception class?
Is there any difference between synchronized methods and synchronized statements?
How to instantiate static nested classes in java?
How to perform merge sort in java?
Is zero a positive integer?
Can a class with private constructor be extended?
Is oracle java 11 free?
How does indexof work?
Can we access the non-final local variable, inside the local inner class?
What is the difference between preemptive scheduling and time slicing in java programming?
What is functional interface in java example?
Define a java class.
Explain enumeration in java?
What is the use of isempty in java?