本帖最后由 橘子果酱 于 2015-11-26 23:35 编辑
- <div class="blockcode"><blockquote>public class Demo2 {
- public static void main(String[] args) throws Exception {
- dosome(new BaseStudent());
- }
- public static void dosome(BaseStudent bs){
- bs.study();
- bs.sleep();
- }
- }
- class BaseStudent {
- public void study(){
- System.out.println("基础学习");
- }
- public void sleep(){
- System.out.print("坐着睡");
- }
- }
复制代码
|