tag:blogger.com,1999:blog-8712770457197348465.post2048477938374177048..comments2024-03-28T02:47:19.159-07:00Comments on Javarevisited: What is a Functional interface in Java 8? @FunctionalInterface Annotation Examples Tutorialjavin paulhttp://www.blogger.com/profile/15028902221295732276noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-8712770457197348465.post-29321990707063815582021-11-12T04:18:49.209-08:002021-11-12T04:18:49.209-08:00Hello Vicky, interesting question, I haven't t...Hello Vicky, interesting question, I haven't tested it but I think as long as you have just one abstract method, I think you can extend interface on Functional interface, but it shouldn't be difficult to test, just try in your Eclipse IDE or IDEA javin paulhttps://www.blogger.com/profile/15028902221295732276noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-42673207109786995852021-08-19T04:29:46.942-07:002021-08-19T04:29:46.942-07:00Hello Javin,
Can you please verify doubt regardin...Hello Javin,<br /><br />Can you please verify doubt regarding that a functional interface can extend another interface or not.?<br />Sharanhttps://www.blogger.com/profile/07450598583941435648noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-12872361860317805132020-04-22T13:11:26.974-07:002020-04-22T13:11:26.974-07:00@FunctionalInterface and not the @Functional@FunctionalInterface and not the @FunctionalVikkyhttps://www.blogger.com/profile/11393871014850057851noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-73908387143660310752018-06-25T04:18:46.507-07:002018-06-25T04:18:46.507-07:00It clearly written here that equals() method doens...It clearly written here that equals() method doens't count as an abstract method in terms of functional interface.<br />https://docs.oracle.com/javase/8/docs/api/java/lang/FunctionalInterface.htmlAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-40273060660587136272018-05-08T10:58:03.672-07:002018-05-08T10:58:03.672-07:00I think equals doesn't count here, it is simpl...I think equals doesn't count here, it is simply overriding the equals public method of the Object class. See more here: https://docs.oracle.com/javase/8/docs/api/java/lang/FunctionalInterface.html<br /><br />So Comparator still has only one "countable" abstract method.<br />J. Ernesto Aneiroshttps://www.blogger.com/profile/15587633878909019151noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-72065301448942423632018-01-19T22:22:37.426-08:002018-01-19T22:22:37.426-08:00@Anonymous, just read the intro on Annotations fro...@Anonymous, just read the intro on Annotations from this book and got really impressed with the content and writing. Huge Thanks!! for suggesting this book, ordered all three together. Don't know How I missed this book ... javin paulhttps://www.blogger.com/profile/15028902221295732276noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-43957370075034018632018-01-19T22:11:43.701-08:002018-01-19T22:11:43.701-08:00@Anonymous, Thanks, I really didn't know about...@Anonymous, Thanks, I really didn't know about this point. It make sense though. Sure, I'll refer that book. Thanks for suggestion and adding value to this blog. javin paulhttps://www.blogger.com/profile/15028902221295732276noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-76930241266060195362018-01-19T07:48:43.535-08:002018-01-19T07:48:43.535-08:00Nope, I am not talking about default and static me...Nope, I am not talking about default and static methods at all. <br />Notice that the comparator has two abstract methods <br /> int compare(T o1, T o2) and <br /> boolean equals(Object obj)<br />Both are abstract. <br /><br />Note that an interface may have more than one abstract method, and can still be a functional interface if all but one of them is a redeclaration of the methods in theAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-62581703327693550452018-01-18T17:12:52.054-08:002018-01-18T17:12:52.054-08:00What do you mean sir? That's the whole basic o...What do you mean sir? That's the whole basic of functional interface unless I have a big misconcept. Comparator always have just one abstract method, the compare() method and if there have been any more abstract method added on JDK 8, every Comparator implementation would have blown away and possibly every Java application around the world. <br /><br />I think you are referring to several <a javin paulhttps://www.blogger.com/profile/15028902221295732276noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-37556691512255527042018-01-18T09:45:56.672-08:002018-01-18T09:45:56.672-08:00Good article.
Note that it is not completely true...Good article. <br />Note that it is not completely true to say a functional interface should have exactly one abstract method. Check the comparator interface for reference.Anonymousnoreply@blogger.com