Java encapsulation 💊

preview_player
Показать описание
Java encapsulation getter and setter methods

#java #encapsulation #getters #setters
Рекомендации по теме
Комментарии
Автор

I’ve been watching your videos to help in my programming 3 course and I feel like you simplify everything so well, I’ve really had a breakthrough in my understanding of certain concepts after watching your explanations. Thank you for your work!!

garrickreynolds
Автор

I've never felt more driven to like and comment on every video by any creator. Love your videos.

frankjuuh
Автор

Your videos are amazing! Thank you so much for teaching me Java. I was struggling hard with everything and OOP was not making any sense to me. You deserve so many more views! Keep up the good work!

magl
Автор

You are a legend. You make learning to code so much easier!!

RMJJ
Автор

Your explanation of setters and getters was amazing! Thank you so much

jenniT
Автор

Man I really appreciate what you are doing. Keep going.

javlontursunov
Автор

I loved the way you explain! Thanks a lot

itdasturlashdunyosi
Автор

By far, the best You-Tube tutorial channel!

surfacepro
Автор

Great explanation! It is super well structured and clear. I have to watch your videos while taking other Java course because you explain it so well! Thank you again!

ladalll
Автор

Thanks, Bro. You're the best!

Shoutouts from Brasil.

EMont-qeqf
Автор

Thank you so much! It took me actually quite long to understand this, but finally I understood this method!

mabelle
Автор

Thank you so much for this! We really appreciate it bro!

oumelkheirkhayrieaa
Автор

I've just started to learn java and j discovered your channel and you are pretty good. So I wanted to support your channel with my comments. Thank you so much again for your amazing effort.

unalysuf
Автор

Bro you are the best, you just helped me out for my assignment and seriously the best explaining thank you so much!!!❤

jagsingh
Автор


public class Main {

public static void main(String[] args) {

// Encapsulation = attributes of a class will be hidden or private,
be accessed only through methods (getters & setters)
should make attributes private if you don't have a reason to make them public/protected

Car car = new Car("Chevrolet", "Camaro", 2021);

car.setYear(2022);





}

}

public class Car {


private String make;
private String model;
private int year;

Car(String make, String model, int year){
this.setMake(make);
this.setModel(model);
this.setYear(year);
}

public String getMake() {
return this.make;
}

public String getModel() {
return this.model;
}

public int getYear() {
return this.year;
}

public void setMake(String make) {
this.make = make;
}

public void setModel(String model) {
this.model = model;
}

public void setYear(int year) {
this.year = year;
}

}

BroCodez
Автор

I've probably watched a million hours of coding videos already and just stumbled upon this guy today and the way he simplifies and explain things is next level. Even better than WebDev Simplified, Coding with John or dCode.

youvegotmail
Автор

Thank you for enlightening me with this knowledge :)

IceBeam
Автор

Great explanation, unlike other videos I have seen. I am understanding now the meaning of encapsulation. Thank you.

cuca
Автор

THis really helps me a lot! I am such lucky to find this video.

hjzmxed
Автор

Well Explanation, Thanks teacher for these Videos 🙏 you really helped me a lot ♥️

imsabbar