![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Java
文章平均质量分 68
menghuali
这个作者很懒,什么都没留下…
展开
-
java语言概述
(1)import java.io.*;public class Exam1_1{ public static void main(String args[]) { System.out.println("This is my first Java Application Program."); }} import用来将系统提供的特定功能的模块原创 2006-10-08 15:47:00 · 450 阅读 · 0 评论 -
第十八章 堆
原创 2006-11-07 15:41:00 · 463 阅读 · 0 评论 -
第十七章 树
原创 2006-11-07 15:41:00 · 487 阅读 · 0 评论 -
第十四章 链表
原创 2006-11-07 15:38:00 · 412 阅读 · 0 评论 -
第十五章 堆栈
原创 2006-11-07 15:39:00 · 408 阅读 · 0 评论 -
对象的上转型对象
上转型对象操作子类继承或重写的方法时,就是通知对应的子类对象去调用这些方法.因此,如果子类重写了父类的某个方法后,对象的上转型对象调用这个方法时,一定是调用这个重写的方法.可以将对象的上转型对象再强制转换到一个子类对象,这是,该子类对象又具备了子类的所有功能和属性class ape{ private int n=100; void crySpeak(String s) { System.原创 2006-10-15 11:50:00 · 903 阅读 · 0 评论 -
多态
class animal{ void cry() { }}class dog extends animal{ void cry() { System.out.println("汪汪…………"); }}class cat extends animal{ void cry() { System.out.println("喵喵…………"); } }class Example4_20{ public原创 2006-10-15 12:08:00 · 405 阅读 · 0 评论 -
类的继承
1 子类的继承(在同一包中)class Father{ private int money; float weight,height; String head; void speak(String s) { System.out.println(s); }}class Son extends Father{ String hand,foot; }public class Example4_原创 2006-10-14 10:32:00 · 653 阅读 · 0 评论 -
访问权限
(1)私有变量和私有方法对于私有成员变量或方法,只有在本类中创建该类的对象时,这个对象才能访问自己的私有成员变量和类中的私有方法。class Example4_14{ private int money; Example4_14() { money = 2000; } private int getMoney() { return money; } public static void原创 2006-10-13 22:32:00 · 546 阅读 · 0 评论 -
abstract类和abstract方法
1 . abstract 类不能用new运算符创建对象abstract class A{ abstract int min(int x,int y); int max(int x,int y) { return x>y?x:y; }}class B extends A{ int min(int x,int y) { return x }}public class Example4_21{原创 2006-10-15 12:36:00 · 1086 阅读 · 0 评论 -
对象
(1)class XiyoujiRemwu{ float height,weight ; String head, ear,foot,mouth; void speak(String s); {System.out.println(s);} class A{ public st原创 2006-10-09 09:47:00 · 533 阅读 · 0 评论 -
第十九章 映射
原创 2006-11-07 15:41:00 · 512 阅读 · 0 评论