日期:2014-05-20 浏览次数:20733 次
package demo11;
public class Business {
String name;
String sex;
int age;
int handupm;
public Business(){
name="zhangsan";
sex="laddy";
age=18;
handupm=2000000;
}
}
class Manage{
String na;
String se;
int ag;
int hunm;
public void print()
{
System.out.println(this.na+" "+this.se+" "+this.ag+" "+this.hunm+" ");
}
public static void main(String[] args)
{
// TODO Auto-generated method stub
Manage man=new Manage();
}
}
public Business(){
name="zhangsan";
sex="laddy";
age=18;
handupm=2000000;
}
public Business(String name,String sex,int age,int handupm){
this.name=name;
this.sex=sex;
this.age=age;
this.handupm=handupm;
}
package demo1;
class Business {
String name;
String sex;
int age;
int handupm;
public Business() {
name = "zhangsan";
sex = "laddy";
age = 18;
handupm = 2000000;
}
}
public class Manage {
private String na;
private String se;
private int ag;
private int hunm;
/**
* 这是第一种方法,通过构造方法赋值
* @param na
* @param se
* @param ag