Class, Object, Entity: What's the difference?

后端 未结 3 1090
有刺的猬
有刺的猬 2021-02-05 23:11

I also see other terms as well: Entity Object, Value Object, etc. Are there other terms out there that I should know, and what do these terms refer to?

Can the differen

3条回答
  •  囚心锁ツ
    2021-02-05 23:53

    In general a class is a construct which defines a set of properties and methods/functions while an Object is the actual instance of a class which is created at runtime.

    Sample class definition:

    public class Example{
    
    ...
    
    }
    

    The following will create an instance of the Example class as an Object at runtime;

    new Example();
    

提交回复
热议问题