Skip to main content
typos, phrasing
Source Link
SusanW
  • 1k
  • 1
  • 10
  • 16

If getters and setters violate encapsulation and true OO than, then I'm seriously in trouble.

I always felt an object represents what everwhatever best comes to mind that you need it to function asdo.

I have just finished writing a program that generates Mazes in Java, and I have class that represents "Maze Squares". I have data in this class that represents coordinates, walls and booleans ectetc.

I have to have some way to change/manipulate/access this data! What do I do without getters and setters? Java doesn't use properties and setting all my data that is local to this class to public is DEFINITELY a violation of encapsulation and OO.

If getters and setters violate encapsulation and true OO than I'm seriously in trouble.

I always felt an object represents what ever best comes to mind you need it to function as.

I just finished writing a program that generates Mazes in Java, I have class that represents "Maze Squares". I have data in this class that represents coordinates, walls and booleans ect.

I have to have some way to change/manipulate/access this data! What do I do without getters and setters? Java doesn't use properties and setting all my data that is local to this class to public is DEFINITELY a violation of encapsulation and OO.

If getters and setters violate encapsulation and true OO, then I'm seriously in trouble.

I always felt an object represents whatever best comes to mind that you need it to do.

I have just finished writing a program that generates Mazes in Java, and I have class that represents "Maze Squares". I have data in this class that represents coordinates, walls and booleans etc.

I have to have some way to change/manipulate/access this data! What do I do without getters and setters? Java doesn't use properties and setting all my data that is local to this class to public is DEFINITELY a violation of encapsulation and OO.

Post Made Community Wiki by Dale
Source Link
Nayrb
  • 2.5k
  • 1
  • 19
  • 22

If getters and setters violate encapsulation and true OO than I'm seriously in trouble.

I always felt an object represents what ever best comes to mind you need it to function as.

I just finished writing a program that generates Mazes in Java, I have class that represents "Maze Squares". I have data in this class that represents coordinates, walls and booleans ect.

I have to have some way to change/manipulate/access this data! What do I do without getters and setters? Java doesn't use properties and setting all my data that is local to this class to public is DEFINITELY a violation of encapsulation and OO.