Why is a class called an abstraction of an object?

I understand that a class is essentially a plan of an object, but the idea that a class is an “abstraction” of an object will make it a little harder for me to wrap my head ... If anyone could tell me the real meaning of the expression: “A class is object abstraction, "I would be very grateful.

My confusion is that this statement has been interpreted differently by different people ...

Does abstraction mean:

  • Work with the basics of the system, not the deep subtleties of this system?

or it means that:

  1. Only an abstract class can be considered as an abstraction of an object?

Thanks in advance, Abhigyan

+4
source share
3 answers

- , . , , , .. , , .. , .

, ?

, , (, )

?

, , abstract Java.

, , , , .

+4

. , .

+3

(). , .

- . .

: .

:

public class Cat {
    String name;
    String color;
}

object Cat ("Missy", "grey");
object Cat ("Whiskers", "orange");
object Cat ("Fluffy", "black");

, .

+1

Source: https://habr.com/ru/post/1665181/


All Articles