Posts Tagged ‘语言’

软件建模三元素

偶然的灵感, 能否以后编程就和写作文一样呢? 这也应该是面向对象的终极目标吧.下面这个是经常出现在教科书上的例子.
Person tom = new Person() – > tom is a Person
Dog trigger = new Dog() -> trigger is a Dog
List<Person> friends = new ArrayList<Person> – > Person have Person friends
Person implements Emotianal,HumanBehave -> Person behave Emotional and surely behave as a human.
interface Emotional{ sadly(); happily();} ->Emotional including sadly and happily doing things.
interface [...]