3 Years Java Spring Boot Interview | Java Interview | Spring Boot |Original from @InsightsInstructor
Fullstack Edutech · 3,970 words · 20 min read · EN

Below is the complete, readable transcript of 3 Years Java Spring Boot Interview | Java Interview | Spring Boot |Original from @InsightsInstructor by Fullstack Edutech on YouTube. Read the full text, copy any part you need, or generate a transcript for any video with our free tool.
okay so you have worked on Java it right yeah I have worked on it so in Java 8 let's say we have two interfaces interface a and interface B and they both have same default method right and suppose a class is there that class implements both interfaces all right now suppose we want to print
the value which is inside the default method so how jvm will know that which method it has to print you understood the question Yeah so basically uh we have two interfaces and they have the same method and uh we have a class and that class is uh implementing uh both of the interfaces
so we want to print that common method right yes yeah so basically uh this kind of situation normally we say as Diamond problem and um uh in Java 8 if two interfaces have same default method and a class implements both interfaces then uh normally uh like Java compil throw the error compilation error so it will
ask to uh override the uh that method and forcefully we will have to override that method and there uh in that method like uh we have to say like which um which interface method we want to uh call like uh suppose we have interface a and interface B so we will have to
declare their interface a do super and then that method name so like this way that compare error will go and we can decide that uh which which interface default method has to be called okay okay okay so why do you think the private method was introduced in Java interface private in interface yes yeah private was introduced to
support mostly the whatever the Logics which has been written inside the static and uh default methods uh which was introduced in Java 8 and this private was introduced in Java 9 actually so sometimes what happens is like suppose we are writing any logic in default a static method and that Logics that logic
Transcribe another video
Paste any YouTube, Instagram or TikTok link to get a free transcript.