> For the complete documentation index, see [llms.txt](https://allen8807.gitbook.io/blog/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://allen8807.gitbook.io/blog/ocn/mit_ics/lecture_15.md).

# 第十五课 抽象数据类型，类与方法

## Lecture 15: Abstract data types,classes and methods

## 2017-11-17

* 上节课介绍了一些
* 如何定义一个抽象的类？
* 这节课对于学过面向对象的人比较简单，所以也就简单写了
* 主要介绍了几个概念
* 类是创建实例的模板 Class - template for creating instances of an object
* 数据隐藏就是指仅通过方法来访问数据 Data hiding - one can only access instance values through defined methods&#x20;
* Python不提供数据隐藏功能
* 一些python的内置方法，对象: self, \_\_init\_\_, \_\_str\_\_,

  \_\_cmp\_\_, \_\_eq\_\_,
* 重载


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://allen8807.gitbook.io/blog/ocn/mit_ics/lecture_15.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
