A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

© fyw2lyf 中级黑马   /  2015-5-27 21:36  /  320 人查看  /  0 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

冰箱IceBox:
                        开门open()
                        关门close()
                大象Elephant:
                        进去in()
                测试类:
                        main()
                        {
                                冰箱对象.open();
                                大象对象.in();
                                冰箱对象.close();
                        }
                伪代码:
                        class IceBox
                        {
                                public void open()
                                {
                                        System.out.println("打开冰箱门");
                                }
                                public void close()
                                {
                                        System.out.println("关闭冰箱门");
                                }
                        }
                        class Elephant
                        {
                                public void in()
                                {
                                        System.out.println("大象Come in!");
                                }
                        }
                        class Test
                        {
                                public static void main(String[] args)
                                {
                                        冰箱对象.open();
                                        大象对象.in();
                                        冰箱对象.close();
                                }
                        }

0 个回复

您需要登录后才可以回帖 登录 | 加入黑马