王梦然

04 2013 档案

例题4-15/4-16
摘要:public class Example4_15{private int money;Example4_15(){money=2000;}private int getMoney(){return money;}public static void main(String args[]){Example4_15 exa=new Example4_15();exa.money=3000;int m=exa.getMoney();System.out.println("money="+m);}}class Employee{private double salary=1800; 阅读全文

posted @ 2013-04-14 21:45 快乐的铲屎官 阅读(99) 评论(0) 推荐(0)

例题4-10/4-11
摘要:class People{double getArea(double x,int y){return x*y;}int getArea(int x,double y){return (int)(x*y);}double getArea(float x,float y,float z){return(x*x+y*y+z*z)*2.0;}}public class Example4_10{public static void main(String args[]){People zhang=new People();System.out.println("面积:"+zhang. 阅读全文

posted @ 2013-04-14 19:23 快乐的铲屎官 阅读(153) 评论(0) 推荐(0)

导航