Abstraction & Encapsulation

--Originally published at diegotc2016

Abstraction

For example if I say a table you understand the concept it does not matter I I said it was a wooden table or a glass table. Abstraction means that we focus of the certain qualities of something. You have to take what is relevant. For example the taste of a table or the smell of a table are irrelevant

Abstraction & Encapsulation

Encapsulation

Encapsulation can be defined by the fields of an object and class should only be read or written by the method of that class. Hide some parts of the code except for a few that are most necessary. For example a phone , you don’t care how your phone works, you only care that you can take pictures with it, use apps, watch videos, hear to music, etc.

Abstraction & Encapsulation

I got this out of lynda.com Foundations of Programming: Object-Oriented Design by Simon Allardice

 


Abstraction & Encapsulation

Masterie: What is encapsulation?

--Originally published at Alan TC201

“Encapsulation”
Now after all this information we can dig more in terms of Java programing, first of all, the term “encapsulation”.
This means that, to have a better program, that is easy to read, to understand and fix the classes need to be private, so that the methods of a class only affect the data or the objects inside that class.

The encaptulation is used whent you have two packages with objects, clases and methods and you do not want that one package know the variables of the other package.

For example, here I have two diferent packages one that has the spesifications, the other one has the methods.

Masterie: What is encapsulation?

 

Masterie: What is encapsulation?

But when I change my methods to privite the encapsulated class could not recive inmormation from the Persona class.

Masterie: What is encapsulation?

Here is different info about encaptulation: http://www.lynda.com/Java-tutorials/Understanding-encapsulation/377484/421339-4.html

Masterie: What is encapsulation?


Masterie: What is encapsulation?

Cheryl, probably, was a nice gal. Probably not

--Originally published at Ce qui est chouette

Ken…you did this to me…you ruined me. Information, regarding Lychrel Numbers, gathered from…oh, god…Wikipedia.

Lychrel kind of an anagram for Cheryl, Wade VanLandingham’s girlfriend. This Wade guy sucked at making up names.

“¿Qué debería poner?” pregunto yo acerca del blog.
“2” responde Marijose Dávila Diosdado, A01630826, de TC101 Winter 2016.

2

I feel the term playground has not caught up with many of my beloved readers -actually, I only have one reader, Miguel, notice me, Ken D: -so here I go: playground refers to the place where the little object boys and little object girls go play around, show off their methods -totally not a euphemism -and meet class instances, imports and guys of the like. It’s like a playground, but for objects, from classes…and then I, but he said and I go ooh ooh, you go aah aah, Lalalala, Ah Lalala

Back to business, or basics, here’s the playground and the console:

Cheryl, probably, was a nice gal. Probably notCheryl, probably, was a nice gal. Probably not

Now, on with the foolishly long code for the class Lychrel:

Cheryl, probably, was a nice gal. Probably notCheryl, probably, was a nice gal. Probably notCheryl, probably, was a nice gal. Probably not

Once again, I’ve defeated the evil corporation of WSQ’s. I’ve mastered the mastering masteries, Master -they’re to the left of the post.

“Onwards, noble steed!”

-The about guy.


Cheryl, probably, was a nice gal. Probably not

Euclid’s Choice

--Originally published at Ce qui est chouette

Instead of choosing between his two offsprings [as Sophie], Euclid didn’t have  a a choice, like, at all; this was a bad attempt at making Euclid’s Method fun. I’m not saying that it ain’t so, just that…well…you get it, it’s hard, making math fun when it doesn’t have a cool name.

On with the WSQ.

Here’s the code for the “playground” -because classes play there and stuff -and the console output.

Euclid’s Choice

Euclid’s Choice

Demonstration, at least, of some grasp of OOP and abstraction -because of the perspective.

Now, the class SuNumber:

Some encapsulation knowledge. On with some theory: encapsulation is the process through which information regarding a class is kept “hidden” -unusable outside of the class itself. It is represented in Java through the use of the words “private” or “public” in the object’s attributes or methods.

Euclid’s ChoiceEuclid’s Choice

Ending the least fun of the blog posts. Euclidean method git got from the guy at Cut the Knot

-Me.


Euclid’s Choice