At 7:26 it is said that "we are doing implement not extends so only methods are available and variables are not available". Actually, regardless of what we do implementation of interface or extends of parent class, the variables also gets passed on in child. When we do Subclass obj = new Subclass(); we can see that variables are accessible. The thing with interface is that as the variables are final, so we can't change it. But it is available in child class! Maybe it was just Slip of tongue by Telusko! Enjoying the series so much! Thank you for posting it!❤
@DeeperRed-of1gp8 ай бұрын
Actually according to GPT , In Java, static fields declared in interfaces are accessible through the implementing class, not inherited. When we access B.age in above example in main method, it's not due to inheritance, but rather because interface fields are implicitly public, static, and final. In our case, age is a static field of the A interface, which means it can be accessed using the interface name itself (A.age) or through any class that implements the interface (B.age). So, while it may seem like the field is inherited, it's actually being accessed through the interface. This behavior allows for constants and other shared data to be accessed consistently through the interface, regardless of the implementing class.
@thusith-tec307 Жыл бұрын
Today I subscribed you after watching this video. Your explanation and English pronouncing are better than others. I respect you my new Teacher ❤. Love from Sri Lanka
@jibonjibon8231 Жыл бұрын
Your Process of explaining and the step by step developed example is just blowing my minds. Tomorrow is my java final exam. I have regrate that why I didn't follow you from before! Your teaching system is well pre-planed, clear. I have a request, plz don't stop making tutorial. Keep doing by this way of explaining. Need Python ,framework, Algorithm from you.
@ramyapinapothu9901 Жыл бұрын
Amezing explination everyone saying only theory u are the only one following practical manner ur having great explanation
@obaldalmeida6308 Жыл бұрын
I have been watching Navin sirs old vedios and found this gem ....good to know you are doing well....looking fresh sir ✨ with an upgrade
@daulitech2199 ай бұрын
I read Interface through a book but I couldn't understand it, until I found your video. Thanks
@Arsun-772 ай бұрын
Me videos lo examples tho concept inka baga ardm aythundi anna...❤
@iqbalsingh38484 ай бұрын
your video just blow my mind.. its crazy ... thanks for a lot of information...
@projyoti74897 ай бұрын
What a type of teaching skills ! Mind-blowing
@AmarGrg Жыл бұрын
Hi @Telusko thank you very much for all those wonderful videos. Just started learning java and I am already learning alot. Have a quick question for you, while doing PHP we used to write interfaces for the model entity class, what do you think about it? what might be the pros and cons?
@adityasrinivas30695 ай бұрын
Video #66. and #65 should be interchanged, i.e, explain what is an interface and then explain why it is important. It will be easier to understand.
@Telusko5 ай бұрын
Thanks for the correction
@ajayghode36026 күн бұрын
when we create interface. In interface all methods are 'public abstract' by default. So, no need to write public abstract. we need to define those methods in the class. Otherwise that class will become abstract. Again we need to creat concrete class and define methods. In the interface, we can decleare varibles but those variable will be final and static. So, we have to define those variables like int age=32; String area="Mumbai". Interface don't have memories in the heap. we are doing implements(class implements interface) so we implements only methods NOT variables. As interface don't have memory how can we create non-final or non-static variables in the main class so, we can not be able to change variables ' values.
@sriemandi3978 Жыл бұрын
Merry Christmas Naveen bro
@rajeshwarijindam-dx3xz Жыл бұрын
Anna mi teaching baa super undhi
@manas3326 ай бұрын
Excellent explanation
@alwinvj6487 Жыл бұрын
Thanks for this video🤗
@roshanekka829310 ай бұрын
nice explanation
@Programing-lo3og8 ай бұрын
Thanks You Sir
@mangaraj456 ай бұрын
That's not my age 💀🌚😅
@mohitx3g23 күн бұрын
Bro's age is 43, and he written 44 😂
@raghavsood768 Жыл бұрын
Notes: All variables inside interface are static and final
@mohamedmurshid9794 Жыл бұрын
and public by default too. all the methods inside interface are public and abstract.
@mehakfatima6531 Жыл бұрын
@@mohamedmurshid9794 well they have to be public so that the abstract methods inside it can be used further in derived classes or the whole point of creating a interface will be nothing
@mohamedmurshid9794 Жыл бұрын
@@mehakfatima6531 yep true. But i just added those are public too. Not only static and final. Thank you for this comment.🤗
@chouaibakni2828Ай бұрын
Thanks
@adityamishra_1111 ай бұрын
Are we take scanner (input) at the time of declaring any variables inside the interface.?
@adityamishra_1111 ай бұрын
@Telusko.
@Nothingtosaymore7 ай бұрын
Thank you
@nila-333 Жыл бұрын
Thank you so much
@VishnuSai-u2e2 ай бұрын
Without out main() we can i print any statement?
@srimantamondal8769 Жыл бұрын
Can someone tell me why inside println(), "x:" is used. This variable "x" is not declared anywhere and is not giving any error. Also if it is not a variable then let me know what it is.
@santhosh-benz7 Жыл бұрын
Here inside the println(), "x:" is used , it is provided by the IDE ( here VS code ) , which means it remains you to code here or pass the parameter , which makes you aware about the line of code . It needs some thing based on the code . I think you can Understand 😅
@shubhrajit21176 ай бұрын
You can disable it by going to settings -> Java hints -> None
@Hemanth83439 Жыл бұрын
kollada mona 👌
@Ambitious675 Жыл бұрын
Thank you so much sir :)
@filmbuzz94196 ай бұрын
Can i implement another method in class B
@sushmithakn60039 ай бұрын
Why this error come - failed to resolve main method code lens :inter faceis not a valid java identifier
@rohitgundam22753 ай бұрын
How is he able to create an object A (since this has the same name as the interface?)
@DSASimplified-zs6ll6 күн бұрын
Bro They have defined the object "obj" with type A which is class name Which is implemented by interface