No video

#40 Encapsulation in Java

  Рет қаралды 166,184

Telusko

Telusko

Күн бұрын

Пікірлер: 81
@prakrutijani4205
@prakrutijani4205 7 ай бұрын
I m experienced java developer .. i started watching this playlist to refresh but.. i ended up actually learning making me realize.. i dont know stuff still.However, I loved your teaching way.
@subajaelango1535
@subajaelango1535 10 ай бұрын
Actually sir you're my favorite trainer 🔥
@Mrindia-k8n
@Mrindia-k8n 3 ай бұрын
00:04 Encapsulation is a part of object oriented programming. 01:33 Data is stored in the brain in the format of variables 02:57 Data access control in object-oriented programming 04:22 Private variables can only be accessed within the same class. 05:56 Data access is restricted using methods. 07:16 Private variables can only be accessed within the class that they are defined in. 08:51 Setting values for variables and accessing them using methods. 10:22 Encapsulation is a way to bind data and methods together
@sakthipriya8653
@sakthipriya8653 Жыл бұрын
Its 2 complete hrs, I'm still watching your playlist. Hats off Mr. Navin 👏
@anuanitha5278
@anuanitha5278 11 ай бұрын
Complete 105 videos
@RR_Programming_Kingdom
@RR_Programming_Kingdom 9 ай бұрын
just don't watch practice it also
@sakthipriya8653
@sakthipriya8653 3 ай бұрын
​@@anuanitha5278Completed
@wolverine3419
@wolverine3419 7 ай бұрын
the way you explain this is magical. I went through videos to find out what encapsulation is and from you i found it. Highly Appreciated Man!
@MFM88832
@MFM88832 4 ай бұрын
You've used the perfect word, it is just "magical". Telusko has a special talent for teaching!
@AyeshaKhan-om9mu
@AyeshaKhan-om9mu Жыл бұрын
Sir your teaching skills are very good 💯 it's very helpful Java playlist for beginners thankyou so much and Allah bless you ✨👍
@navasshariff.s9426
@navasshariff.s9426 Жыл бұрын
@dr.renukapatel9403
@dr.renukapatel9403 Жыл бұрын
the way you explain any topic is awesome, specially examples....
@user-yz5ub8tb2t
@user-yz5ub8tb2t 10 ай бұрын
Sir, you're tin god and one of my favourite and i like you, god will bless you helping a lot for who needs technical stack to grow their skill-set, hope you provide more content like this, finally your flow of explanation was outstanding, and i like you a lot and a lot more...🔥
@jananisrivaideesh1316
@jananisrivaideesh1316 Жыл бұрын
You are superb sir💯💯💯the way of teaching is in easily understandable manner
@SoulOfBharat
@SoulOfBharat 3 ай бұрын
there is no hesitation that you are the best trainer. you really understand how one should be taught it means you understand the problem a student face while studying and grasping the concept. love from the capital of india and from Bihar.
@shortnews1819
@shortnews1819 Жыл бұрын
You are Superb, the way you taught is excellent.
@LearnEnglishMM
@LearnEnglishMM 10 ай бұрын
You are using examples from personal life; it’s good to let others learn things well. Try to give a minimum of two examples in each video per topic. Thanks.
@debarghyamajumder998
@debarghyamajumder998 2 ай бұрын
Your Teaching is Great Sir! 💛
@aniketankush218
@aniketankush218 3 ай бұрын
Sir your way of explaining is just brilliant!👏
@samnasaif4794
@samnasaif4794 Ай бұрын
this is absolutely understandable java concepts simply ,thanku naveen sir
@subbu9739
@subbu9739 Ай бұрын
your explination is awesome sir, easy to understand and grasp the concept.thank You🙏
@yashaswinihm4288
@yashaswinihm4288 8 ай бұрын
Just explained like a wow.Omg wow 🔥
@SB-pk2ss
@SB-pk2ss Жыл бұрын
you don't need to use a static block if you just want to initialze a field private static String name = "Phone"; would be enough. but if you need some complex manipulations, requires several lines of code, than yes, there static blocks come in
@RGMUTEX
@RGMUTEX 9 ай бұрын
Your teaching style is marvelous❤. Love from Nepal!
@user-xc5tg3zi4e
@user-xc5tg3zi4e 6 ай бұрын
@Telusko I have a question sir, We can even call the getAge() method by simply passing the value and calling it under Demo class, even age is private in class Human. I tried it and worked well, which states that we don't need setAge() method to set the value, can simply pass through the getAge() and fetch the value. Please explain sir, how I am wrong and why do we need get, set methods here? I am pretty sure there must be point behind there :) For eg: public int getAge(int a) { age = a; return a; } And while calling it under class demo, we can define: Human obj = new Human(); int final = obj.getAge(56); System.out.println(final);
@Tolly633
@Tolly633 5 ай бұрын
If u try to just age()method passing the value under demo class from calling function age method to called function age() without get method. If u can declare variables as private u can't access variables without set or get methods. But u did declare variables as private at the same time u used get /set method. That's the reason u got an output(u haven't no error)
@user-mq2cb4rx4g
@user-mq2cb4rx4g Жыл бұрын
That is fantastic, sir, you are a legend.
@user-yj7ub6dw5n
@user-yj7ub6dw5n 10 ай бұрын
Sir your explanation is amezing tqs alot you are equal to God for me
@DistantGlowingStar
@DistantGlowingStar 9 ай бұрын
Nice explanation of getters and setters
@shivanatchiyarmariammal
@shivanatchiyarmariammal 29 күн бұрын
instaead of the word behaviour we can use methods right ..? please correct me If I am wrong ...!
@aanchalthakur9088
@aanchalthakur9088 Ай бұрын
sir i got ur point but in set method why we used void returntype as uh had told in method concept that we use void as returntype when we dont want to return anything ....plz clear this doubt of mine
@khankashif7586
@khankashif7586 9 ай бұрын
Explanation way is so easy
@it.b.61.prashantsingh87
@it.b.61.prashantsingh87 5 ай бұрын
Explanantion was top notch! But my question is we use private access modifier so that other classes can't use it, and then we create get and set method through which we can change and access the value, if we are including get and set method for private variable, why we simply can't keep the vaiable public if in the end we need to access and change the data.
@ch.Rambabu-goud
@ch.Rambabu-goud 6 ай бұрын
I am extremely happy to see your vedioed
@shaikbasha3882
@shaikbasha3882 Жыл бұрын
you stored lot of information in your brain and by seeing itself everyoone can understand :) just kidding , lovely explanation
@vallikumar1281
@vallikumar1281 Жыл бұрын
expected one.. Thank you sir..
@lepakshirh7419
@lepakshirh7419 2 ай бұрын
Tqsm sir for sharing knowledge thoroughly🤝🫂
@vinodonweb
@vinodonweb 10 ай бұрын
amazing teacshing method 👍👍
@rahulpawar5927
@rahulpawar5927 6 ай бұрын
very good explaination sir.
@saurabhhedau3300
@saurabhhedau3300 9 ай бұрын
best ever example you told here sir
@balajikavitha8835
@balajikavitha8835 Жыл бұрын
Nice explanation
@suieyP7
@suieyP7 8 ай бұрын
Superb sir. Thank you very much.
@vigneshrp1294
@vigneshrp1294 6 ай бұрын
I have a doubt from a long time and couldnt find the answer.......We use access modifiers to control the accessiblity within the program to ensure encapsulation.....so if we have a private variable and if still we can access it through a public getter method then what is the use of having a private variable.....it can be public instead right?
@aishwaryasinnur2256
@aishwaryasinnur2256 Жыл бұрын
really easy to understand sir 😍😍thanku
@kaku-bm1ti
@kaku-bm1ti 4 ай бұрын
thank you sir 👑
@luckygold777
@luckygold777 Жыл бұрын
Sir, can u please tell me what is the point if we can access the data and change the data even if it's private? what is the advantage of the variable not being accessed directly.....Please respond as soon as possible sir.
@a.m.e.e.e.r
@a.m.e.e.e.r 10 ай бұрын
As you heard he said only via methods, so if you don't make "setName" method for example, no one can change the data, while they can GET the data via "getName" it depends on the methods you create. and yeah everyone can touch it if they have your pc, but it's different when it's on the app/game/web you make. Hope it helped. 😊
@jatinsharma3792
@jatinsharma3792 7 ай бұрын
Yes, but is it important to make the class in such a way that we should asign the private vable value directly withou using the setter method.? Why we need to create the strcuture to set the data only and to fetch the data ? I mean what is the actual real life purpose of doin this activity which you are saying Encapsulation ?
@syedfaizan5841
@syedfaizan5841 11 ай бұрын
Thanks ❤
@adityapatil7396
@adityapatil7396 11 ай бұрын
Can we achieve encapsulation by declaring variables protected instead of private ?
@manikandans1996
@manikandans1996 Жыл бұрын
Sir pls provide notes for this playlist
@muhammedashkar692
@muhammedashkar692 Жыл бұрын
breaks my head and takes his name and says "oh there is his name"🤣🤣
@navasshariff.s9426
@navasshariff.s9426 Жыл бұрын
Allah bless uuu🎉
@broyea6943
@broyea6943 7 ай бұрын
I just learned about encapsulation right now😂, does this mean I should stop using constructors and use setters instead?
@sirrisathwik8332
@sirrisathwik8332 Жыл бұрын
telugaa bhaiyaa
@puruagni1927
@puruagni1927 4 ай бұрын
Why are you not updating VS Code? Please update VS Code.
@vinaysaiakula9475
@vinaysaiakula9475 8 ай бұрын
Sir what if we keep method as private 🤔
@iam_robinroy
@iam_robinroy Жыл бұрын
❤tnku sir
@ganeshkumarv3895
@ganeshkumarv3895 Жыл бұрын
why there isn't this.age = age or return this.age ?
@aeroabrar_31
@aeroabrar_31 Жыл бұрын
Yes you can, but the variable name which is coming as a parameter should be 'age' .
@ArpithaHK
@ArpithaHK Жыл бұрын
The parameter which is passing to setter method is same as the instance variable, then "this" must be used. for ex: public void setAge(String age); { this.age = age; }
@sachinkhatri1077
@sachinkhatri1077 Жыл бұрын
U can use that if u set your methods parameters name exactly like instance variables. By the way thats a good practice to use proper name in methods and use this keyword to refer.
@Mrindia-k8n
@Mrindia-k8n 3 ай бұрын
HE is talking about the movie wall -e where he used the words pixel pls give a me a like
@kitsune-hc5zk
@kitsune-hc5zk 11 күн бұрын
so its basically POJO and BEANs
@chemistryworl
@chemistryworl 11 ай бұрын
U r lit sir 🔥
@NirajKumar-ip1gq
@NirajKumar-ip1gq Жыл бұрын
obj.setAge(a: 30); I didn't understood this
@reshmashetty1471
@reshmashetty1471 9 ай бұрын
"break my head and say... Hey! I got the data" 🤣🤣🤣🤣
@rdxdevil5083
@rdxdevil5083 Жыл бұрын
very good sir i got it but encapsulation means only public method can access it encapsulation means data hiding but we are going to public the data can someone clear mt doubt....
@neerajgarg9096
@neerajgarg9096 11 ай бұрын
we are not going to public data member instead we are going to public the member functions which help to get and set the value of our private data member see the below code class Encapsulation{ private int x; // now this data member is hidden from outside world as it is private but to set its value and get its value we need to define functions which are public and can be used public void set(int a){ x=a; } public int get(){ return x; } }
@Realfactsofficial-mz4tz
@Realfactsofficial-mz4tz 4 ай бұрын
sir your video good but it is too lenthy and long
@prudvidiyya9226
@prudvidiyya9226 8 ай бұрын
@0shaad
@0shaad Жыл бұрын
adam scandler's pixel
@kvelez
@kvelez 10 ай бұрын
public class Main{ public static void main(String[] args) { Human me = new Human(30, "Mario"); System.out.println(me.GetName() + " " + me.GetAge()); } } class Human{ private int age;//private attribute private String name; public Human(int age, String name){//constructor this.age = age;//setting this.name = name; } public void SetAge(int age){//set value this.age = age; } public int GetAge(){//output return age; } public void SetName(String name){//setter this.name = name; } public String GetName(){//getter return name; } }
@princet0429
@princet0429 11 ай бұрын
mm
@Unknown373d
@Unknown373d 2 ай бұрын
fire uuuuu
@adithidesai8690
@adithidesai8690 10 ай бұрын
6:28 Jeffrey Dahmer's way of accessing the data
@sultankodirov
@sultankodirov 8 ай бұрын
you can user my name as a trainer hahahaaahahhaahahahah
@sultankodirov
@sultankodirov 8 ай бұрын
I use by the way )))))hahahaha
@authenticworld7271
@authenticworld7271 Жыл бұрын
And your age is 41
@thebacheafghan
@thebacheafghan Жыл бұрын
you cannot define someone's age. you are ageist. you are cancelled.
@dummyaxle2099
@dummyaxle2099 10 ай бұрын
You use too many words, cut it by 1/3
#41 Getters and Setters in Java
2:55
Telusko
Рет қаралды 105 М.
ISSEI & yellow girl 💛
00:33
ISSEI / いっせい
Рет қаралды 25 МЛН
艾莎撒娇得到王子的原谅#艾莎
00:24
在逃的公主
Рет қаралды 53 МЛН
OMG what happened??😳 filaretiki family✨ #social
01:00
Filaretiki
Рет қаралды 13 МЛН
I Took a LUNCHBAR OFF A Poster 🤯 #shorts
00:17
Wian
Рет қаралды 6 МЛН
#42 This keyword in Java
9:45
Telusko
Рет қаралды 128 М.
Java LinkedHashMap
5:24
Do Some Dev
Рет қаралды 710
Generics In Java - Full Simple Tutorial
17:34
Coding with John
Рет қаралды 1 МЛН
Why High Performers Might Be Hurting Your Team
6:42
Simon Sinek
Рет қаралды 1,8 М.
#26 Stack And Heap in Java
12:37
Telusko
Рет қаралды 234 М.
#39 Static Block in java
7:17
Telusko
Рет қаралды 108 М.
#95 Comparator vs Comparable in Java
15:43
Telusko
Рет қаралды 172 М.
#51 This and Super Method in Java
12:11
Telusko
Рет қаралды 102 М.
ISSEI & yellow girl 💛
00:33
ISSEI / いっせい
Рет қаралды 25 МЛН