摘要: 上篇博客谈到了Java中类的继承,但是那些远远不能满足我们在实际操作中的需要,那么怎么才能让子类的功能更强大,并且具有父类的属性呢?一:父类1 public class A { 2 3 final String name="A"; 4 5 void A1(){}; 6 ... 阅读全文
posted @ 2014-10-09 23:18 Iridescent_zzy 阅读(129) 评论(0) 推荐(0)
摘要: 继承作为面向对象的三大基本特征之一,也是Java中必不可少的组成部分。因此,Java中类的继承和其他面向对象语言的继承都是大同小异的。继承的优点:通过继承可以简化类的定义.Java只支持单继承,不允许多重继承.可以有多承继承,即一个类可以继承某个类的子类,如类B继承了类A,类C又继承了类B,那么C也... 阅读全文
posted @ 2014-10-09 23:07 Iridescent_zzy 阅读(302) 评论(0) 推荐(0)
摘要: 面向对象基本概念:封装、继承、多态封装:就是把数据和行为结合在一起形成统一的整体,并对对象使用者隐藏数据的实现过程。继承:Java继承是使用已存在的类的定义作为基础建立新类的技术,继承避免了对一般类和特殊类之间共同特征进行的重复描述。多态:多态指同一个实体同时具有多种形式。Java作为一种面向对象语... 阅读全文
posted @ 2014-10-09 22:41 Iridescent_zzy 阅读(136) 评论(0) 推荐(0)
摘要: Problem Description很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。这让很多学生很反感。不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。Input本题目包含多组测试,请处理到... 阅读全文
posted @ 2014-08-06 11:25 Iridescent_zzy 阅读(131) 评论(0) 推荐(0)
摘要: DescriptionAngel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M 2 #include 3 #include 4 #defi... 阅读全文
posted @ 2014-08-01 12:28 Iridescent_zzy 阅读(243) 评论(0) 推荐(0)
摘要: DescriptionThere is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a... 阅读全文
posted @ 2014-08-01 10:58 Iridescent_zzy 阅读(175) 评论(0) 推荐(0)
摘要: Description一个每块地板标记着0~9某个数字的迷宫,其中标记1的地板不可以走,标记2~9的地板可以不花时间地跳到任意相同数字的位置,也可以和标记0的地板一样向前后左右任意方向花1个单位时间移动1的距离。给出起点和终点,求起点到终点的最短时间。Input每组数据第一行一个n,表示尺寸,2 ... 阅读全文
posted @ 2014-08-01 09:31 Iridescent_zzy 阅读(227) 评论(0) 推荐(0)
摘要: DescriptionYou have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you ... 阅读全文
posted @ 2014-07-31 16:03 Iridescent_zzy 阅读(188) 评论(0) 推荐(0)
摘要: Problem DescriptionGive you three sequences of numbers A, B, C, then we give you a number X. Now you need to calculate if you can find the three numbe... 阅读全文
posted @ 2014-07-31 11:43 Iridescent_zzy 阅读(251) 评论(0) 推荐(0)
摘要: Description— The Brother of mine, the Head of Monastic Order wants to know tomorrow about the results long-term researches. He wants to see neither mo... 阅读全文
posted @ 2014-07-31 09:52 Iridescent_zzy 阅读(386) 评论(0) 推荐(0)