wolf
package com.wh.Demo50; /**
* @author 王恒
* @datetime 2017年4月7日 下午4:40:54
* @description
* 分析:子类重写父类的方法时,调用子类的构造方法
* 这是一道逻辑题,比较绕,不知道程序怎么走的时候,用debug模式,追踪走一边,所有方法均打断点
*/
public class Demo04_wolf {
public static void main(String[] args) {
Wolf w = new Wolf("灰太狼", 32.3);
System.out.println(w);
}
} class Animal { private String desc; public Animal() {
this.desc = getDesc();
} public String getDesc() {
return "Animal";
} public String toString() {
return desc;
}
} class Wolf extends Animal {
private String name;
private double weight; public Wolf(String name, double weight) {
// super();
this.name = name;
this.weight = weight;
} public String getDesc() {
return "Wolf[name=" + name + ", weight=" + weight + "]";
} }
运行结果:
Wolf[name=null, weight=0.0]
wolf的更多相关文章
- HDU 5115 Dire Wolf 区间dp
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5115 Dire Wolf Time Limit: 5000/5000 MS (Java/Others ...
- hdu 3046 Pleasant sheep and big big wolf 最小割
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3046 In ZJNU, there is a well-known prairie. And it a ...
- hdu 1222 Wolf and Rabbit
Problem Description There is a hill with n holes around. The holes are signed from 0 to n-1. A rabbi ...
- 动态规划(区间DP):HDU 5115 Dire Wolf
Dire wolves, also known as Dark wolves, are extraordinarily large and powerful wolves. Many, if not ...
- 分布式批处理平台(wolf)简介
"wolf"即狼,狼的适应性很强.可栖息范围包括苔原.草原.森林.荒漠.农田等多种生境:具有敏锐的观察力.专一的目标.默契的配合,它们总能依靠团体的力量达成目标. 分布式批处理平台 ...
- Wolf and Rabbit(gcd)
Wolf and Rabbit Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)T ...
- hdu 5115 Dire Wolf(区间dp)
Problem Description Dire wolves, also known as Dark wolves, are extraordinarily large and powerful w ...
- HDU 3046 Pleasant sheep and big big wolf(最小割)
HDU 3046 Pleasant sheep and big big wolf 题目链接 题意:一个n * m平面上,1是羊.2是狼,问最少要多少围墙才干把狼所有围住,每有到达羊的路径 思路:有羊和 ...
- HDU 1222 Wolf and Rabbit(gcd)
HDU 1222 Wolf and Rabbit (最大公约数)解题报告 题目链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid= ...
- 转化为用欧几里得算法判断互质的问题D - Wolf and Rabbit
Description There is a hill with n holes around. The holes are signed from 0 to n-1. A rabbit must h ...
随机推荐
- 用Python+selenium打开IE浏览器和Chrome浏览器的问题
这几天在学Python+selenium自动化,对三大浏览器Firefox,Chrome和IE都做了尝试,也都分别下载了对应的webdriver,如:geckodriver.chromedriver. ...
- (转)Jetty实战之 安装 运行 部署
http://blog.csdn.net/kongxx/article/details/7218767 本文地址:http://blog.csdn.NET/kongxx/article/details ...
- C# ref 和 out 的使用
private void button1_Click(object sender, EventArgs e) { ; ; Fun(ref a,ref b); //把a的地址和b的地址 传递过去 Mes ...
- 去掉二级页面 tabs 菜单, 修改返回按钮
imports: [ /*引入的模块 依赖的模块*/ BrowserModule, ComponentsModule, IonicModule.forRoot(MyApp,{ tabsHideOnSu ...
- Nginx.conf介绍
在此记录下Nginx服务器nginx.conf的配置文件说明, 部分注释收集与网络. #运行用户user www-data; #启动进程,通常设置成和cpu的数量相等worker_process ...
- day37-1 面向对象高阶
目录 面向对象高阶 isinstance issubclass 反射(自省) 模块的使用 放在类的使用 call 面向对象高阶 isinstance 判断是否为实例化对象,以后可以用来取代type 和 ...
- LoadRunner中遭遇交互数据加密的处理方案
在使用LoadRunner时,当你录制完脚本后可能会发现在交互的数据中会存在密文,或者当拿到接口文档时就已经明确的描述出了交互数据的加解密方法,你该怎么办? 事实上这样的遭遇如今已经成为了一种常态,发 ...
- PHP第四天 函数引用传值
<?php function f1($p1,&$p2){ $p1++; $p2++; $result= $p1+ $p2; return $result;}$v1=10;$v2=20;$ ...
- lucene多条件查询”搜索—BooleanQuery
/** * “多条件查询”搜索—BooleanQuery * BooleanQuery也是实际开发过程中经常使用的一种Query. * 它其实是一个组合的Query,在使用时可以把各种Query对象添 ...
- 如鹏网JAVA培训笔记1(晓伟整理)
JDK(Java Developmet Kit) JRE(Java RunTime Environment)的区别: JRE只有运行JAVA程序的环境,没有开发相关的工具;JDK=JRE+开发相关的工 ...