Javatpoint Logo
Javatpoint Logo

Java Method isDefault() Method

The isDefault () method of Method class returns true if this method is a default method; returns false otherwise. A default method is a public non-abstract instance method, that is, a non-static method with a body, declared in an interface type.

Syntax

Parameter

No parameter is passed.

Returns

true if and only if this method is a default method as defined by the Java Language Specification.

Throw

Does not throw the exception.

Example 1

Test it Now

Output:

run:
add = false
bitCount = false
equals = false
toString = false
toString = false
hashCode = false
abs = false
pow = false
min = false
max = false
compareTo = false
compareTo = false
intValue = false
longValue = false
floatValue = false
doubleValue = false
valueOf = false
signum = false
divide = false
remainder = false
shiftLeft = false
and = false
andNot = false
or = false
toByteArray = false
xor = false
bitLength = false
byteValueExact = false
clearBit = false
divideAndRemainder = false
flipBit = false
gcd = false
getLowestSetBit = false
intValueExact = false
isProbablePrime = false
longValueExact = false
mod = false
modInverse = false
modPow = false
multiply = false
negate = false
nextProbablePrime = false
not = false
probablePrime = false
setBit = false
shiftRight = false
shortValueExact = false
subtract = false
testBit = false
byteValue = false
shortValue = false
wait = false
wait = false
wait = false
getClass = false
notify = false
notifyAll = false
BUILD SUCCESSFUL (total time: 0 seconds)

Example 2

Test it Now

Output:

run:
equals = false
toString = false
hashCode = false
clone = false
compareTo = false
compareTo = false
readObject = false
writeObject = false
normalize = false
normalize = false
parse = false
after = false
before = false
from = false
getTime = false
setTime = false
getDate = false
UTC = false
convertToAbbr = false
getCalendarDate = false
getCalendarSystem = false
getCalendarSystem = false
getCalendarSystem = false
getDay = false
getHours = false
getJulianCalendar = false
getMillisOf = false
getMinutes = false
getMonth = false
getSeconds = false
getTimeImpl = false
getTimezoneOffset = false
getYear = false
setDate = false
setHours = false
setMinutes = false
setMonth = false
setSeconds = false
setYear = false
toGMTString = false
toInstant = false
toLocaleString = false
BUILD SUCCESSFUL (total time: 0 seconds)





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA