Getters, Setters and Constructors (JAVA)

Asked

Viewed 32 times

0

Good afternoon guys! Okay? I hope so! Well, I started my studies about 3 months ago in java and programming in general. Well, I am in a stage selection process and I started to study POO (Object Oriented Programming), and the part of inheritance, polymorphism and etc I managed to understand very well!! Now, what’s leaving me a little doubt are the methods: Getters, Setters and Builders. The fundamentals and reasons for use I was able to understand with some clarity, but what left me an immense doubt is: Which method receives value? For example, receive a number, String and etc and do the necessary actions (validation, arithmetic operation or what the program requires). And what method prints the value? What method would I use for printing? " System.out.print("Result: " + a. get() or a.set() ); " This is one of my biggest doubts and this is taking a hold on my learning curve. Could you help me clear up this doubt? In short: What is GET responsible for? What is SET responsible for? What the Builder is responsible for?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.