title
8.22 Interface in Java 8 Default , Static Methods | New features

description
Java Simplified LiveCourse : https://bit.ly/java-pro-telusko Advance Java with Spring Boot Live Course : https://bit.ly/adv-java-telusko Complete java developer Course : https://bit.ly/complete-java\ Coupon Code: TELUSKO10 (10% off) For More Queries WhatsApp or Call on : +919008963671 website : https://courses.telusko.com/ Instagram : https://www.instagram.com/navinreddyofficial/ Linkedin : https://in.linkedin.com/in/navinreddy20 TELUSKO Android App : https://bit.ly/TeluskoApp Discord : https://discord.gg/D8hWe9BqfF Practical : https://www.youtube.com/watch?v=bYzIXYqmTDo Java and Spring Framework For beginners with Spring Boot : - http://bit.ly/3LDMj8D Java Tutorial for Beginners (2023) :- http://bit.ly/3yARVbN Editing Monitors : https://amzn.to/2RfKWgL https://amzn.to/2Q665JW https://amzn.to/2OUP21a. Editing Laptop : ASUS ROG Strix - (new version) https://amzn.to/2RhumwO Camera : https://amzn.to/2OR56AV lens : https://amzn.to/2JihtQo Mics https://amzn.to/2RlIe9F https://amzn.to/2yDkx5F Subscribe to our other channel: Navin Reddy : https://www.youtube.com/channel/UCxmkk8bMSOF-UBF43z-pdGQ?sub_confirmation=1 Telusko Hindi : https://www.youtube.com/channel/UCitzw4ROeTVGRRLnCPws-cw?sub_confirmation=1 Subscribe to the channel and learn Programming in easy way. Java Tutorial for Beginners : https://goo.gl/p10QfB Scala Tutorials for Java Developers : https://goo.gl/8H1aE5 C Tutorial Playlist : https://goo.gl/8v92pu Android Tutorial for Beginners Playlist : https://goo.gl/MzlIUJ XML Tutorial : https://goo.gl/Eo79do Design Patterns in Java : https://goo.gl/Kd2MWE Socket Programming in Java : https://goo.gl/jlMEbg Spring MVC Tutorial : https://goo.gl/9ubbG2 OpenShift Tutorial for Beginners : https://goo.gl/s58BQH Spring Framework with Maven : https://goo.gl/MaEluO Sql Tutorial for Beginners : https://goo.gl/x3PrTg String Handling in Java : https://goo.gl/zUdPwa Array in Java : https://goo.gl/uXTaUy Java Servlet : https://goo.gl/R5nHp8 Exception Handling in Java : https://goo.gl/N4NbAW

detail
{'title': '8.22 Interface in Java 8 Default , Static Methods | New features', 'heatmap': [{'end': 970.204, 'start': 933.521, 'weight': 0.877}], 'summary': "Covers java 8 interfaces, emphasizing the purpose of defining class types, introducing stream api, increasing total methods in list interface from x to x+y, discussing method implementation incompatibility between java 1.7 and 1.8, addressing java's multiple inheritance issue through interfaces, and explaining the evolution of interface capabilities in java 8.", 'chapters': [{'end': 240.023, 'segs': [{'end': 55.39, 'src': 'embed', 'start': 21.08, 'weight': 3, 'content': [{'end': 22.621, 'text': "let's say you want to go for.", 'start': 21.08, 'duration': 1.541}, {'end': 28.243, 'text': 'so, if you remember the concept of c programming, in c programming, whenever you want to define a method what we saw?', 'start': 22.621, 'duration': 5.622}, {'end': 33.664, 'text': 'function we used to first declare the function we should define the function and then we used to use the function right,', 'start': 28.243, 'duration': 5.421}, {'end': 35.786, 'text': 'or we used to call the function In Java.', 'start': 33.664, 'duration': 2.122}, {'end': 38.97, 'text': 'if you want to do the same thing, we use interface, where you can declare the methods.', 'start': 35.786, 'duration': 3.184}, {'end': 45.398, 'text': 'In class, you define it and then you call it, right? So we use interface in lots of applications.', 'start': 39.911, 'duration': 5.487}, {'end': 52.287, 'text': 'So if we talk about different inbuilt classes and interface in Java, there are lots of interface which are inbuilt, right? So we use interface.', 'start': 45.438, 'duration': 6.849}, {'end': 55.39, 'text': "So that's what's new in that.", 'start': 53.669, 'duration': 1.721}], 'summary': 'In java, interfaces are used to declare and define methods, with many inbuilt interfaces available.', 'duration': 34.31, 'max_score': 21.08, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4e_RsZWdiSc/pics/4e_RsZWdiSc21080.jpg'}, {'end': 123.41, 'src': 'embed', 'start': 79.933, 'weight': 1, 'content': [{'end': 83.174, 'text': 'so by default it is public and abstract.', 'start': 79.933, 'duration': 3.241}, {'end': 89.336, 'text': "so even if you don't mention it, even if you, if you're not writing this part, it is by default public abstract.", 'start': 83.174, 'duration': 6.162}, {'end': 92.937, 'text': "and that's the main difference between abstract class and interface, right.", 'start': 89.336, 'duration': 3.601}, {'end': 95.058, 'text': 'so, on the other hand, if we talk about abstract class,', 'start': 92.937, 'duration': 2.121}, {'end': 104.844, 'text': 'we have this concept of abstract class here in which you define a class and you make the class as abstract.', 'start': 97.102, 'duration': 7.742}, {'end': 107.165, 'text': 'right. this is a is abstract.', 'start': 104.844, 'duration': 2.321}, {'end': 111.346, 'text': "and then let's say, class name is, uh, abc.", 'start': 107.165, 'duration': 4.181}, {'end': 117.288, 'text': 'and what we do is, in this class you can, you can declare the methods and you can, you can define methods right.', 'start': 111.346, 'duration': 5.942}, {'end': 119.909, 'text': 'so we can also write some method which has definition.', 'start': 117.288, 'duration': 2.621}, {'end': 123.41, 'text': "that's what the main difference between interface and class, right.", 'start': 119.909, 'duration': 3.501}], 'summary': 'Default public and abstract, main difference between abstract class and interface, defining methods is the key difference.', 'duration': 43.477, 'max_score': 79.933, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4e_RsZWdiSc/pics/4e_RsZWdiSc79933.jpg'}, {'end': 195.21, 'src': 'embed', 'start': 168.629, 'weight': 0, 'content': [{'end': 179.418, 'text': 'we have a concept of stream api in which you have certain methods of stream api, so you have methods like, uh, stream itself.', 'start': 168.629, 'duration': 10.789}, {'end': 180.939, 'text': 'so stream is a method.', 'start': 179.418, 'duration': 1.521}, {'end': 184.202, 'text': 'now, this stream method was introduced in java 1.8.', 'start': 180.939, 'duration': 3.263}, {'end': 189.646, 'text': 'okay, it was not there before and it was introduced in one of the interface call as least.', 'start': 184.202, 'duration': 5.444}, {'end': 195.21, 'text': 'So List is an interface in Java which we use in Collection API right?', 'start': 190.587, 'duration': 4.623}], 'summary': 'Java 1.8 introduced stream api with methods like stream for list interface.', 'duration': 26.581, 'max_score': 168.629, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4e_RsZWdiSc/pics/4e_RsZWdiSc168629.jpg'}], 'start': 0.922, 'title': 'Java 8 interfaces and stream api', 'summary': 'Provides an overview of interfaces in java 8, emphasizing their purpose in defining the type of a class. it also explains the difference between interface and abstract class in java, highlighting the introduction of stream api in java 8, which added extra methods to the list interface, increasing the total methods from x to x+y, where x is the original number of methods and y is the additional methods related to stream api.', 'chapters': [{'end': 55.39, 'start': 0.922, 'title': 'Java 8 interfaces overview', 'summary': 'Provides an overview of interfaces in java 8, emphasizing their purpose in defining the type of a class and the widespread use of interfaces in various inbuilt classes and applications.', 'duration': 54.468, 'highlights': ['The primary purpose of using interfaces in Java is to define the type of a class, similar to declaring and using functions in C programming.', 'Interfaces are widely used in various inbuilt classes and applications in Java.']}, {'end': 149.009, 'start': 55.85, 'title': 'Interface vs abstract class in java', 'summary': 'Explains the difference between interface and abstract class in java, highlighting that in interface, methods are by default public and abstract, while in abstract class, we can have both abstract and defined methods, and that till java 1.7, interface could only declare abstract methods.', 'duration': 93.159, 'highlights': ['In interface, methods are by default public and abstract, while in abstract class, we can have both abstract and defined methods.', 'Till Java 1.7, interface could only declare abstract methods, not define them.', 'The main difference between abstract class and interface is that interface can only declare abstract methods, while abstract class can have both abstract and defined methods.']}, {'end': 240.023, 'start': 149.449, 'title': 'Java 8 stream api', 'summary': 'Discusses the introduction of stream api in java 8, which added extra methods to the list interface, increasing the total methods from x to x+y, where x is the original number of methods and y is the additional methods related to stream api.', 'duration': 90.574, 'highlights': ['Java 8 introduced stream API, adding extra methods to the List interface. In Java 8, the stream API was introduced, adding extra methods to the List interface, increasing the total methods from x to x+y, where x is the original number of methods and y is the additional methods related to stream API.', 'Stream method was introduced in Java 1.8. The stream method was introduced in Java 1.8, not present before, and was added to the List interface.', 'List interface had x methods from 1.2, and in Java 1.8, it got x+y methods. The List interface had x methods from 1.2, and with Java 1.8, it got x+y methods, where x is the original number of methods and y is the additional methods related to stream API.']}], 'duration': 239.101, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4e_RsZWdiSc/pics/4e_RsZWdiSc922.jpg', 'highlights': ['Java 8 introduced stream API, adding extra methods to the List interface.', 'The main difference between abstract class and interface is that interface can only declare abstract methods, while abstract class can have both abstract and defined methods.', 'In interface, methods are by default public and abstract, while in abstract class, we can have both abstract and defined methods.', 'Interfaces are widely used in various inbuilt classes and applications in Java.', 'The primary purpose of using interfaces in Java is to define the type of a class, similar to declaring and using functions in C programming.']}, {'end': 454.752, 'segs': [{'end': 293.839, 'src': 'embed', 'start': 240.243, 'weight': 0, 'content': [{'end': 252.23, 'text': "Example let's say, if one of your friend or earlier, you are working with a software in which you are working with 1.7 and in 1.7 we have X methods,", 'start': 240.243, 'duration': 11.987}, {'end': 258.413, 'text': 'and now you are using the same software on 1.8, where you have some extra methods which are abstract.', 'start': 252.23, 'duration': 6.183}, {'end': 263.236, 'text': 'then, unfortunately, your class will implement all the methods.', 'start': 259.173, 'duration': 4.063}, {'end': 264.277, 'text': "that's not possible, right?", 'start': 263.236, 'duration': 1.041}, {'end': 266.678, 'text': 'because you have not changed the software.', 'start': 264.277, 'duration': 2.401}, {'end': 270.341, 'text': 'you have just changed the java version, so it will not work.', 'start': 266.678, 'duration': 3.663}, {'end': 272.563, 'text': 'so what, uh, oracle has done?', 'start': 270.341, 'duration': 2.222}, {'end': 273.964, 'text': 'it in java 1.8.', 'start': 272.563, 'duration': 1.401}, {'end': 274.984, 'text': 'what they did?', 'start': 273.964, 'duration': 1.02}, {'end': 282.65, 'text': 'instead of declaring this methods inside inside list as abstract, they have defined it, hold on.', 'start': 274.984, 'duration': 7.666}, {'end': 284.411, 'text': 'can we define a method inside interface?', 'start': 282.65, 'duration': 1.761}, {'end': 285.112, 'text': 'is it possible?', 'start': 284.411, 'duration': 0.701}, {'end': 287.834, 'text': 'uh, that means we can define an interface.', 'start': 285.112, 'duration': 2.722}, {'end': 293.839, 'text': "so that's your interface, and let's name it as least.", 'start': 289.195, 'duration': 4.644}], 'summary': 'In java 1.8, abstract methods inside interfaces are defined, allowing for method definition within interfaces.', 'duration': 53.596, 'max_score': 240.243, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4e_RsZWdiSc/pics/4e_RsZWdiSc240243.jpg'}, {'end': 454.752, 'src': 'embed', 'start': 400.227, 'weight': 3, 'content': [{'end': 402.467, 'text': "so we can, let's say let me get one method here which is void.", 'start': 400.227, 'duration': 2.24}, {'end': 406.23, 'text': 'show right now this method.', 'start': 402.467, 'duration': 3.763}, {'end': 407.252, 'text': 'i want to define it.', 'start': 406.23, 'duration': 1.022}, {'end': 413.325, 'text': "so what we'll do is, well, in order to define this, we just have to write default keyword here.", 'start': 407.252, 'duration': 6.073}, {'end': 417.948, 'text': 'okay, if you just write virtual, it will not work.', 'start': 415.347, 'duration': 2.601}, {'end': 421.49, 'text': 'you just have to mention one more keyword which is default.', 'start': 417.948, 'duration': 3.542}, {'end': 427.513, 'text': 'so that means inside interface you can define a method if that is default.', 'start': 421.49, 'duration': 6.023}, {'end': 434.596, 'text': 'okay, you have to use this default keyword and once again, this code will only work in 1.8.', 'start': 427.513, 'duration': 7.083}, {'end': 442.023, 'text': "so let's say, if you are using NetBeans, if you are using Eclipse, you have to make sure that your JDK version is 1.8.", 'start': 434.596, 'duration': 7.427}, {'end': 444.505, 'text': "okay. so yeah, that's how you can define it.", 'start': 442.023, 'duration': 2.482}, {'end': 445.726, 'text': "so that's how you.", 'start': 444.505, 'duration': 1.221}, {'end': 446.486, 'text': 'you define a.', 'start': 445.726, 'duration': 0.76}, {'end': 451.37, 'text': 'you, uh, create a default method interface.', 'start': 446.486, 'duration': 4.884}, {'end': 451.77, 'text': "now there's a.", 'start': 451.37, 'duration': 0.4}, {'end': 454.752, 'text': "there's one little problem here, you know.", 'start': 451.77, 'duration': 2.982}], 'summary': 'In java, default methods can be defined in interfaces using the default keyword, only compatible with jdk 1.8.', 'duration': 54.525, 'max_score': 400.227, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4e_RsZWdiSc/pics/4e_RsZWdiSc400227.jpg'}], 'start': 240.243, 'title': 'Java version update impact', 'summary': 'Discusses the impact of updating java versions on software, highlighting method implementation incompatibility between java 1.7 and 1.8, and the introduction of method definition inside interfaces in java 1.8. it also covers defining methods inside interfaces in java, including the use of the default keyword in version 1.8, enabling the declaration and definition of methods like add and show.', 'chapters': [{'end': 293.839, 'start': 240.243, 'title': 'Java version update impact on software', 'summary': 'Discusses the impact of updating java versions on software, highlighting the issue of method implementation incompatibility between java 1.7 and 1.8, and the introduction of method definition inside interfaces in java 1.8.', 'duration': 53.596, 'highlights': ['Oracle introduced a solution in Java 1.8 by defining the extra methods inside the interface instead of declaring them as abstract, enabling method definition inside interfaces.', 'The incompatibility issue arises when using the same software on Java 1.7 (with X methods) and Java 1.8 (with extra abstract methods), resulting in failed class implementation due to the unchanged software.', 'The impact of Java version update is illustrated through the example of a software transition from Java 1.7 to 1.8, leading to method implementation issues due to the introduction of new abstract methods.']}, {'end': 454.752, 'start': 293.839, 'title': 'Defining methods inside interfaces', 'summary': 'Discusses how to define a method inside an interface in java, including the use of default keyword in 1.8 version, enabling the declaration and definition of methods, such as add and show.', 'duration': 160.913, 'highlights': ['The default keyword is used to define a method inside an interface in Java, enabling the declaration and definition of methods, such as add and show.', 'This approach is specific to Java 1.8, and the JDK version must be 1.8 for it to work in IDEs like NetBeans or Eclipse.']}], 'duration': 214.509, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4e_RsZWdiSc/pics/4e_RsZWdiSc240243.jpg', 'highlights': ['Oracle introduced a solution in Java 1.8 by defining the extra methods inside the interface instead of declaring them as abstract, enabling method definition inside interfaces.', 'The impact of Java version update is illustrated through the example of a software transition from Java 1.7 to 1.8, leading to method implementation issues due to the introduction of new abstract methods.', 'The incompatibility issue arises when using the same software on Java 1.7 (with X methods) and Java 1.8 (with extra abstract methods), resulting in failed class implementation due to the unchanged software.', 'The default keyword is used to define a method inside an interface in Java, enabling the declaration and definition of methods, such as add and show.', 'This approach is specific to Java 1.8, and the JDK version must be 1.8 for it to work in IDEs like NetBeans or Eclipse.']}, {'end': 815.33, 'segs': [{'end': 479.467, 'src': 'embed', 'start': 454.752, 'weight': 0, 'content': [{'end': 463.478, 'text': "uh, in java we doesn't, we don't have a concept of multiple inheritance is because it creates a diamond problem.", 'start': 454.752, 'duration': 8.726}, {'end': 464.879, 'text': 'right, and what is the diamond problem?', 'start': 463.478, 'duration': 1.401}, {'end': 469.593, 'text': "so let's say, we have, let's say, we have two classes.", 'start': 464.879, 'duration': 4.714}, {'end': 474.861, 'text': 'we have class A and we have class B, and in class A we have a method which is show.', 'start': 469.593, 'duration': 5.268}, {'end': 479.467, 'text': 'in class B also, we have a method which is show and then we have creating class C.', 'start': 474.861, 'duration': 4.606}], 'summary': 'Java does not support multiple inheritance due to the diamond problem.', 'duration': 24.715, 'max_score': 454.752, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4e_RsZWdiSc/pics/4e_RsZWdiSc454752.jpg'}, {'end': 554.852, 'src': 'embed', 'start': 528.34, 'weight': 4, 'content': [{'end': 533.763, 'text': 'and in both this smith, in both this class and in both this interface we have with every show.', 'start': 528.34, 'duration': 5.423}, {'end': 537.366, 'text': "and let's say, if i create a new class which is c, so this implements.", 'start': 533.763, 'duration': 3.603}, {'end': 541.489, 'text': 'this is not extend, this is implements both the interfaces.', 'start': 537.366, 'duration': 4.123}, {'end': 549.969, 'text': 'now, in this scenario, if i create the object of c, it is compulsory to have that method show here right,', 'start': 542.384, 'duration': 7.585}, {'end': 552.531, 'text': 'because they are declared that they are not defined.', 'start': 549.969, 'duration': 2.562}, {'end': 554.852, 'text': 'so we can implement that.', 'start': 552.531, 'duration': 2.321}], 'summary': "Creating a new class 'c' implements interfaces, ensuring compulsory method 'show' is implemented.", 'duration': 26.512, 'max_score': 528.34, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4e_RsZWdiSc/pics/4e_RsZWdiSc528340.jpg'}, {'end': 610.113, 'src': 'embed', 'start': 582.19, 'weight': 1, 'content': [{'end': 585.331, 'text': 'so if you have an interface in your class, what we do?', 'start': 582.19, 'duration': 3.141}, {'end': 588.653, 'text': 'we override those methods.', 'start': 585.331, 'duration': 3.322}, {'end': 599.458, 'text': "right, but since in I, in interface I, we already defined a method which is show, we don't have to define it here, right.", 'start': 588.653, 'duration': 10.805}, {'end': 600.76, 'text': "that's the advantage.", 'start': 599.458, 'duration': 1.302}, {'end': 602.823, 'text': 'and we can simply say obj.show.', 'start': 600.76, 'duration': 2.063}, {'end': 610.113, 'text': 'but since in Java, in Java we can, so one class can implement two interfaces, right.', 'start': 602.823, 'duration': 7.29}], 'summary': 'In java, a class can implement multiple interfaces, and override methods defined in those interfaces, such as the show method in interface i.', 'duration': 27.923, 'max_score': 582.19, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4e_RsZWdiSc/pics/4e_RsZWdiSc582190.jpg'}], 'start': 454.752, 'title': "Java's multiple inheritance issue", 'summary': "Delves into java's restriction on multiple inheritance due to the diamond problem, explaining its impact on method calls and the use of interfaces to address this limitation. it also covers the implementation of java interfaces, the necessity to override methods, the use of default keyword, and scenarios involving class extension and method calls.", 'chapters': [{'end': 528.34, 'start': 454.752, 'title': "Java's issue with multiple inheritance", 'summary': "Discusses java's restriction on multiple inheritance due to the diamond problem, explaining how it leads to ambiguity in method calls and how interfaces can be used to address this limitation.", 'duration': 73.588, 'highlights': ['Java restricts multiple inheritance due to the diamond problem, which causes ambiguity in method calls. Java restricts multiple inheritance to avoid the diamond problem, where ambiguity arises in method calls when a class extends multiple classes with the same method names. This restriction prevents confusion in method resolution.', 'Interfaces can be used to achieve a form of multiple inheritance in Java. In Java, interfaces allow for achieving a form of multiple inheritance by defining methods that can be implemented by classes. This provides a way to inherit behavior from multiple sources without the ambiguity caused by extending multiple classes.']}, {'end': 815.33, 'start': 528.34, 'title': 'Java interfaces and multiple inheritance', 'summary': 'Discusses the implementation of java interfaces, the issue of multiple inheritance, and the necessity to override methods, highlighting the problem of diamond inheritance and the use of default keyword. it also covers scenarios where a class extends an interface and the expected output when calling methods.', 'duration': 286.99, 'highlights': ['Java does not support multiple inheritance due to the diamond problem, creating the need to override methods in scenarios where a class implements two interfaces with the same method defined using the default keyword. Java does not support multiple inheritance due to the diamond problem, resulting in the need to override methods in scenarios where a class implements two interfaces with the same method defined using the default keyword.', 'Explanation of the necessity to define methods when a class extends an interface and the expected output when calling the methods, emphasizing the importance of understanding inheritance and method overriding. Explanation of the necessity to define methods when a class extends an interface and the expected output when calling the methods, emphasizing the importance of understanding inheritance and method overriding.', 'Demonstration of a scenario where a class extends an interface, and the expected output when calling the method, showcasing the behavior of method inheritance and extension. Demonstration of a scenario where a class extends an interface, and the expected output when calling the method, showcasing the behavior of method inheritance and extension.']}], 'duration': 360.578, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4e_RsZWdiSc/pics/4e_RsZWdiSc454752.jpg', 'highlights': ['Java restricts multiple inheritance due to the diamond problem, preventing confusion in method resolution.', 'Interfaces in Java allow achieving a form of multiple inheritance by defining methods that can be implemented by classes.', 'Java does not support multiple inheritance due to the diamond problem, resulting in the need to override methods in scenarios where a class implements two interfaces with the same method defined using the default keyword.', 'Explanation of the necessity to define methods when a class extends an interface and the expected output when calling the methods, emphasizing the importance of understanding inheritance and method overriding.', 'Demonstration of a scenario where a class extends an interface, showcasing the behavior of method inheritance and extension.']}, {'end': 1098.977, 'segs': [{'end': 871.806, 'src': 'embed', 'start': 843.85, 'weight': 1, 'content': [{'end': 848.013, 'text': 'so default will have the low priority and normal methods will have high priority.', 'start': 843.85, 'duration': 4.163}, {'end': 851.277, 'text': 'okay, this is also called as third rules.', 'start': 849.136, 'duration': 2.141}, {'end': 858.58, 'text': 'so this this comes under a topic called as third rules in java.', 'start': 851.277, 'duration': 7.303}, {'end': 861.161, 'text': "okay, so so that's how it works.", 'start': 858.58, 'duration': 2.581}, {'end': 868.704, 'text': 'so if you have a class which extends a class, an interface, then it will give the priority to the class method.', 'start': 861.161, 'duration': 7.543}, {'end': 871.806, 'text': 'not the interface method sounds good.', 'start': 868.704, 'duration': 3.102}], 'summary': 'In java, default methods have low priority, while class methods have high priority when a class extends an interface.', 'duration': 27.956, 'max_score': 843.85, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4e_RsZWdiSc/pics/4e_RsZWdiSc843850.jpg'}, {'end': 970.204, 'src': 'heatmap', 'start': 933.521, 'weight': 0.877, 'content': [{'end': 940.624, 'text': 'this signature method name is equals, which accepts the object as a parameter which returns a boolean value.', 'start': 933.521, 'duration': 7.103}, {'end': 944.406, 'text': 'this is a method which is already there inside object class right.', 'start': 940.624, 'duration': 3.782}, {'end': 953.919, 'text': 'so if you have any method in your interface which overwrites object class methods, then this will give you error.', 'start': 945.555, 'duration': 8.364}, {'end': 955.68, 'text': 'okay, this is not possible.', 'start': 953.919, 'duration': 1.761}, {'end': 960.803, 'text': 'so these are the certain things you have to remember when you work with default methods and interface.', 'start': 955.68, 'duration': 5.123}, {'end': 964.641, 'text': "okay, so that's your default methods.", 'start': 962.259, 'duration': 2.382}, {'end': 970.204, 'text': 'if you have any questions, you can put in a comment section so that I will rectify it using the screen recording.', 'start': 964.641, 'duration': 5.563}], 'summary': 'Default methods in interfaces can overwrite object class methods, leading to errors. remember these considerations when working with default methods and interfaces.', 'duration': 36.683, 'max_score': 933.521, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4e_RsZWdiSc/pics/4e_RsZWdiSc933521.jpg'}, {'end': 1008.083, 'src': 'embed', 'start': 975.448, 'weight': 0, 'content': [{'end': 979.39, 'text': "with that, okay, so that's the default methods.", 'start': 975.448, 'duration': 3.942}, {'end': 982.392, 'text': "next we'll talk about is static methods.", 'start': 979.39, 'duration': 3.002}, {'end': 993.198, 'text': 'now, if you are working with Java 1.6 or 1.7, static methods were not allowed, but now, since we are working with java 8,', 'start': 982.392, 'duration': 10.806}, {'end': 996.359, 'text': 'it supports static methods.', 'start': 993.198, 'duration': 3.161}, {'end': 999.18, 'text': 'okay, that means you can create an interface which is,', 'start': 996.359, 'duration': 2.821}, {'end': 1008.083, 'text': "let's say this is interface i and in this interface i you can actually define methods which are static.", 'start': 999.18, 'duration': 8.903}], 'summary': 'Java 8 supports static methods in interfaces, not allowed in java 1.6 or 1.7.', 'duration': 32.635, 'max_score': 975.448, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4e_RsZWdiSc/pics/4e_RsZWdiSc975448.jpg'}, {'end': 1059.306, 'src': 'embed', 'start': 1030.953, 'weight': 2, 'content': [{'end': 1035.714, 'text': "you don't even have to create the object of i because that is we have a static method.", 'start': 1030.953, 'duration': 4.761}, {'end': 1043.284, 'text': 'we can simply say i dot, show, which is that powerful, right.', 'start': 1035.714, 'duration': 7.57}, {'end': 1048.07, 'text': "so yeah, so that's how we can use interfaces.", 'start': 1043.284, 'duration': 4.786}, {'end': 1051.836, 'text': 'we can use the static methods inside interface in java 8..', 'start': 1048.07, 'duration': 3.766}, {'end': 1055.5, 'text': 'again, if you try to run this code inside 1.7, it will not work.', 'start': 1051.836, 'duration': 3.664}, {'end': 1059.306, 'text': 'it will only work in 1.8.', 'start': 1055.5, 'duration': 3.806}], 'summary': 'In java 8, interfaces can use static methods. running code in 1.7 will not work.', 'duration': 28.353, 'max_score': 1030.953, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4e_RsZWdiSc/pics/4e_RsZWdiSc1030953.jpg'}], 'start': 815.33, 'title': 'Java 8 interface methods', 'summary': 'Covers java 8 interface features including default and static methods, not allowed in java 1.6 or 1.7 but supported in java 8. it explains usage and compatibility, emphasizing the evolution of interface capabilities.', 'chapters': [{'end': 955.68, 'start': 815.33, 'title': 'Java interface rules', 'summary': 'Explains the rules and concepts related to default methods and interfaces in java, emphasizing the priority of class methods over interface methods and the limitations regarding overriding object class methods within interfaces.', 'duration': 140.35, 'highlights': ["The priority of class methods over interface methods is explained, with the class method having higher priority, as indicated by the example output of method 'a' being called.", 'Default methods are associated with low priority, while normal methods have high priority, exemplifying the third rule in Java.', 'The concept of default methods in interfaces is detailed, highlighting the limitation that arises when defining a method with the same signature as a method in the object class, resulting in an error.']}, {'end': 1098.977, 'start': 955.68, 'title': 'Java 8 interface methods', 'summary': 'Discusses the new features in java 8 interfaces, including default methods and static methods, which were not allowed in java 1.6 or 1.7 but are supported in java 8. it explains how to use static methods inside an interface and highlights that the code will only work in java 8.', 'duration': 143.297, 'highlights': ['The chapter explains the new features in Java 8 interfaces, including default methods and static methods, which were not allowed in Java 1.6 or 1.7 but are supported in Java 8.', 'The chapter demonstrates how to use static methods inside an interface, highlighting that it allows calling the static method directly without creating an object of the interface, a feature only available in Java 8.', 'The chapter emphasizes that the code for using static methods inside an interface will only work in Java 8 and will not run in Java 1.7.', 'The chapter encourages viewers to subscribe to the channel to receive updates about Q&A sessions for asking questions related to the topic.']}], 'duration': 283.647, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4e_RsZWdiSc/pics/4e_RsZWdiSc815330.jpg', 'highlights': ['The chapter explains the new features in Java 8 interfaces, including default methods and static methods, which were not allowed in Java 1.6 or 1.7 but are supported in Java 8.', "The priority of class methods over interface methods is explained, with the class method having higher priority, as indicated by the example output of method 'a' being called.", 'The chapter demonstrates how to use static methods inside an interface, highlighting that it allows calling the static method directly without creating an object of the interface, a feature only available in Java 8.', 'Default methods are associated with low priority, while normal methods have high priority, exemplifying the third rule in Java.']}], 'highlights': ['Java 8 introduced stream API, adding extra methods to the List interface.', 'Oracle introduced a solution in Java 1.8 by defining the extra methods inside the interface instead of declaring them as abstract, enabling method definition inside interfaces.', 'The chapter explains the new features in Java 8 interfaces, including default methods and static methods, which were not allowed in Java 1.6 or 1.7 but are supported in Java 8.', 'The main difference between abstract class and interface is that interface can only declare abstract methods, while abstract class can have both abstract and defined methods.', 'Java restricts multiple inheritance due to the diamond problem, preventing confusion in method resolution.']}