public class Liti1 {
public static void Main (string[] args) {
TODO auto-generated Method Stub
Address A = new address ("China", "Liaoning Province", "Dandong", "Tongjiang Street",
123456);
System.out.println ("Country" + a.getcountry () + ", province" + a.getprovince ()
+ ", City" + a.getcity () + ", street" + a.getstreet () + ", postcode"
+ A.getpost ());
}
}
Class Address {
String Country;
String Province;
String City;
String Street;
int post;
Public Address (String country, String province, String city, String Street,
int post) {
This.setcountry (country);
This.setprovince (province);
This.setcity (city);
This.setstreet (street);
This.setpost (POST);
}
public void Setcountry (String country) {
This.country = country;
}
public void Setprovince (String province) {
this.province = Province;
}
public void Setcity (String city) {
this.city = City;
}
public void Setstreet (String street) {
This.street = Street;
}
public void Setpost (int post) {
This.post = post;
}
Public String Getcountry () {
return this.country;
}
Public String getprovince () {
return this.province;
}
Public String getcity () {
return this.city;
}
Public String Getstreet () {
return this.street;
}
public int Getpost () {
return this.post;
}
}
public class liti2{
public static void Main (string[] args) {
TODO auto-generated Method Stub
Employee me = new Employee ("140201115", "Shing", 5000, 0.1);
System.out.println ("Number:" + me.getnumber () + "name" + me.getname ()
+ "Base Salary" + me.getbasal () + "growth rate" + me.getincrease () + "total wage"
+ me.salary ());
}
}
Class Employee {
private String number;
private String name;
private double basal;
private double increase;
Public Employee (string number, string name, double basal, double increase) {
This.setnumber (number);
This.setname (name);
This.setbasal (basal);
This.setincrease (Increase);
}
public void Setnumber (String number) {
This.number = number;
}
public void SetName (String name) {
THIS.name = name;
}
public void setbasal (double basal) {
This.basal = basal;
}
public void setincrease (double increase) {
This.increase = increase;
}
Public String GetNumber () {
return this.number;
}
Public String GetName () {
return this.name;
}
Public double getbasal () {
return this.basal;
}
Public double getincrease () {
return this.increase;
}
Public double salary () {
return basal * increase;
}
}
Third time Java job