Java Method isDefault() MethodThe 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. SyntaxParameterNo parameter is passed. Returnstrue if and only if this method is a default method as defined by the Java Language Specification. ThrowDoes not throw the exception. Example 1Test it NowOutput: 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 2Test it NowOutput: 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)
Next TopicisSynthetic() Method
|