Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Send variables across classes: Java

Name: Anonymous 2013-07-26 9:06

I'm trying to store variables generated in one class to an array in another class.

i.e (pseudo code):


Class example
{
  x = 2+2;
}

Class stuff
{
  array[0] = example.x;
}


why doesn't this work.

Name: Anonymous 2013-07-26 10:23

>>13
Yes, encapsulation is useless. Learn to derive classes, jackass.

>>14
Encapsulation allows you to add error checking around your setting methods, meaning you won't be fucking up any data by rounding down when you should be rounding up, because you check and make sure in your set method. Additionally, you cut down on code copying.

I could go on and on. People who don't encapsulate data act like hard-asses, but as an employed software engineer I can tell you that it is useful, and you need to know how and why to do it to gain employment.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List