zoukankan      html  css  js  c++  java
  • hausaufgabe--python 36-- Basic knowledge of Class

    00--Define a Class with properties and related functions and try to create a instance 

    Running Result:

    001-- Class 

    to reduce duplicate work, we will use class with some variable and common functions, and user can new related instance without rewrite similar codes. 

    e.g. we write a class as Animal, with the properties with eyes, mouth, nose.. and functions with eating(), running(), sleeping().... related instances can be cat = Animal(), tiger = Animal(), snake = Animal()...

    To create instance with class, the way is similar with call functions. So, to name a class, we start with uper letter, and use small letter for defining a function's name. 

  • 相关阅读:
    SNOI2017炸弹
    tarjan进阶
    BZOJ3331压力
    将多个对象合并为一个对象
    原型模式详解
    HTML5
    isAnimated函数
    让函数执行的各种方式
    zepto源码注解
    mobileTech
  • 原文地址:https://www.cnblogs.com/Shareishappy/p/7481983.html
Copyright © 2011-2022 走看看