Third time Java

Source: Internet
Author: User

Class employee{
int number;
String name;
int Xinshui;
int Zengzhang;
public void Tell () {
System.out.println ("Number:" +number+ ", Name:" +name+ ", Salary:" +xinshui+ ", Growth:" +zengzhang+ ", Salary:" + (Zengzhang+xinshui) ");
}
}
public class dier{
public static void Main (String args[]) {
Employee Per=new employee ();
per.number=140201128;
Per.name= "Liaoning";
per.xinshui=3000;
per.zengzhang=1000;
Per.tell ();
}
}

Class dog{
private String name;
private String color;
private int age;
Public Dog (String name,string color,int age) {
This.setname (name);
This.setcolor (color);
This.setage (age);
}
public void Tell () {
System.out.println ("Name:" +name+ ", Color:" +color+ ", Age:" +age ");
}
Public String GetName () {
return name;
}
public void SetName (String a) {
Name=a;
}
Public String GetColor () {
return color;
}
public void SetColor (String b) {
Color=b;
}
public int getage () {
return age;
}
public void Setage (int c) {
Age=c;
}
}
public class disi{
public static void Main (String args[]) {
Dog Per=new Dog ("Rhubarb", "yellow", 3);
Per.tell ();
}
}

Class user{
private String name;
Private String CDK;
private int num;
Public User () {}
Public User (String name) {
This.setname (name);
}
Public User (String name,string cdk) {
This.setname (name);
THIS.SETCDK (CDK);
}
public void Tell () {
System.out.println ("Name:" +name+ ", Password:" +cdk+ ", Number:" +num ");
}
Public String GetName () {
return name;
}
public void SetName (String a) {
Name=a;
}
Public String GETCDK () {
return CDK;
}
public void Setcdk (String b) {
Cdk=b;
}
public int Getnum () {
return num;
}
public void Setnum (int c) {
Num=c;
}
}
public class diwu{
public static void Main (String args[]) {
User Per=new User ("Linxinhua", "Lxh", 3);
Per.tell ();
}
}

Class address{
String Country;
String Shengfen;
String City;
String Jiedao;
int Youbian;
public void Tell () {
System.out.println ("Country:" +country+ ", Province:" +shengfen+ ", City:" +city+ ", Street:" +jiedao+ ", Zip Code:" +youbian ");

}
public class diyi{
public static void Main (String args[]) {
Address Per=new address ();
Per.country= "China";
Per.shengfen= "Liaoning";
Per.city= "Shenyang";
per.jiedao= "Shen bei xin Qu";
per.youbian=11300;
Per.tell ();
}
}

Third time Java

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.