这里假设有一个父类为Food,其子类为Apple,现在我们要在Apple中重写equals方法,但是测试的时候,我们会控制一些其他的因素来发现比较结果的不同。 情况1: // 父类 Food1 public class Food { 2 public void sayName(){ 3 System ...
分类:
其他好文 时间:
2020-06-04 01:11:06
阅读次数:
54
Class 怎么声明也一个类 //ES5 let Animal=function(type){ this.type=type; this.eat=function(){ console.log('i am eat food'); } } let dog=new Animal('dog'); let ...
分类:
其他好文 时间:
2020-06-01 22:20:12
阅读次数:
92
常见的一些pandas的使用方法 import pandas as pd food_info = pd.read_csv('food_info.csv') print(type(food_info)) print(food_info.dtypes) # print(help(pd.read_csv) ...
分类:
其他好文 时间:
2020-05-30 10:47:33
阅读次数:
97
// 被观察者 class Subject{ // 定义一个对象 constructor(){ // 构造器 可以实例一个对象 this.subs = [] // 存储观察者 } addsub(sub){ // 添加观察者 this.subs.push(sub) } notify(food){ // ...
分类:
其他好文 时间:
2020-05-20 20:24:33
阅读次数:
56
//1.写食物 ; (function (w) { //声明一个数组用来保存食物 var list = []; //1.1.创建食物的构造函数:宽、高、颜色、x、y function Food(width, height, bgcolor, x, y) { this.width = width || ...
分类:
Web程序 时间:
2020-05-19 18:02:12
阅读次数:
67
贪心策略 总是做出当前做好的选择。 贪心策略:将问题分成多个子问题;子问题求局部最优解;局部最优解组合成原问题的解。 分类:简单贪心 区间贪心 咖啡豆问题 题目描述FatMouse prepared M pounds of cat food, ready to trade with the cats ...
分类:
编程语言 时间:
2020-05-14 11:07:53
阅读次数:
78
from multiprocessing import Process, JoinableQueueimport timeimport randomdef producer(name, food, q): for i in range(5): data = '%s生产了%s%s' % (name, ...
分类:
其他好文 时间:
2020-04-23 18:59:40
阅读次数:
38
题目描述: 自己的提交: class Solution: def displayTable(self, orders: List[List[str]]) -> List[List[str]]: table = set() table_l = [] food = set() food_l = [] f ...
分类:
其他好文 时间:
2020-04-20 22:07:14
阅读次数:
84
<div class="tit"> 你爱好的美食是? <form action=""> <input type="checkbox" name="quan" value="quan" id="quan">全选/全不选 <br> <input type="checkbox" name="food" v ...
分类:
其他好文 时间:
2020-04-04 20:33:36
阅读次数:
65
一.yield表达式的应用 在函数内可以采用表达式形式的yield。 >>> def eater(): ... print('Ready to eat') ... while True: ... food=yield ... print('get the food: %s, and start to ...
分类:
编程语言 时间:
2020-03-25 21:39:07
阅读次数:
91