Java Getters & Setters, Encapsulation with Code Examples Tutorial

preview_player
Показать описание
In this Java programming tutorial for beginners, you will learn about getters and setters, encapsulation, and access modifiers (public and private). I will provide an example code with Eclipse that you can follow along with.

In this tutorial, we will create two classes to demonstrate encapsulation with a private field, a getter method, and a setter method. The getter method retrieves the field and the setter method sets the value of the field.

Encapsulation or data hiding is a fundamental concept of object oriented programming. I will go over the other concepts of object oriented programming in a future Java tutorial.

Рекомендации по теме
Комментарии
Автор

such a pleasant voice and such much information in such short amount of time, hope you are safe thanks for this subscribed.

Fnaf-vhcs
Автор

Hey Everyone! I changed the name of my channel to Java made Simple because I plan on making more Java Tutorials soon. Please subscribe! Thank you for the comments!

javamadesimple
Автор

thanks, after looking around, you made this the easiest to digest.... you broke it down word by word and explained it really well, thank you T.T

dylman
Автор

I was stuck on this concept and this video explained it very clearly and concisely. Thank you.

t-bi
Автор

I have no idea about throws and catches yet, then you also had exceptions and im not there yet either :c now im confused with setters and getters, is there a more simpler dummied version

davidobenitez
Автор

What if u had more than one object? how would u refer to which object u wanna change instead of using "this."?

MUSHIN_
Автор

Thanks for your tutorial. Its really helpful

azmyshidqi
Автор

Your English is very clear & good Accent. Thanks. Keep it up :-)

kiranmb
Автор

I have created a pojo class with setters and getters. In class A I have set the values and in class B I wanted to get the values . Kindly help me how to create object and get the values

nikhithanikki
Автор

Great video, i got a test today and this cleared up some doubts i had ^_^

pedroparsbr
Автор

Very explicit, but what if I had to have constructors( both of them)?

mackymichel
Автор

maybe start with the prob getters & setters solve

marksummers
Автор

Thank you so much ! helping me a lot solving a test :) iily
fyi, my score was 95/100 xD

bearaujus