标签:studying package public return
package com.ctu.java.exer; public class TestPerson { public static void main(String[] args){ Person p = new Person(); p.study(); p.showAge(); p.addAge(2); p.showAge(); Person p1 = new Person(); p1.showAge(); } // 属性 } class Person{ String name ; int age ; int sex ; public void study(){ System.out.println("studying"); } public void showAge(){ System.out.println(age); } public int addAge(int i){ age += i; return age ; } }
标签:studying package public return
原文地址:http://9815936.blog.51cto.com/9805936/1601624