Score
0
Watch 25 Star 104 Fork 12

Gitee星球的小活动 / 第 0 届 代码编故事接力赛

Join us
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
让我们点燃程序员写作之魂,一人用代码写一段故事玩玩吧~ spread retract

Clone or download
java-nina 2.43 KB
Copy Edit Web IDE Raw Blame History
苏打绿茶 authored 2020-03-23 14:13 . add java-nina.
//编程语言:java
//故事主题:这天,命运的齿轮开始转动了...
public class TragicNina {
public void main() {
Nina nina = new Nina(); //妮娜,一个五岁的小女孩,从妈妈两年前失踪,和父亲住在一起
nina.setAge(5);
nina.setName("妮娜");
nina.setSex(0);
Alexander alexander = new Alexander();//亚历山大,一条小狗,是妮娜最好的伙伴
alexander.setColour("白色");//皮毛是白色的
alexander.setName("亚历山大");//妮娜叫它亚历山大
alexander.setNina(nina);//最好的伙伴是妮娜
alexander.say("汪汪汪汪...");//
SyntheticBeast syntheticBeast=new SyntheticBeast(); //某天,爸爸为了一个资格,狠心把妮娜和亚历山大炼在了一起
syntheticBeast.setAlexander(alexander);//亚历山大的身体
syntheticBeast.setNina(nina);//妮娜的思想和意识
syntheticBeast.say("大哥哥,一起玩吧");//妮娜说的话
syntheticBeast.say("爸爸,你疼么。。。。");//命运的齿轮。。。
}
class Nina {
private int age;
private int sex;
private String name;
public void setAge(int age) {
this.age = age;
}
public void setSex(int sex) {
this.sex = sex;
}
public void setName(String name) {
this.name = name;
}
}
class Alexander {
private String name;
private Nina nina;
private String colour;
public void setName(String name) {
this.name = name;
}
public void setNina(Nina nina) {
this.nina = nina;
}
public void setColour(String colour) {
this.colour = colour;
}
public void say(String str) {
System.out.println(str);
}
}
class SyntheticBeast {
private String name;
private Nina nina;
private Alexander alexander;
public void say(String str) {
System.out.println(str);
}
public void setName(String name) {
this.name = name;
}
public void setNina(Nina nina) {
this.nina = nina;
}
public void setAlexander(Alexander alexander) {
this.alexander = alexander;
}
}
}

Comment ( 1 )

Sign in for post a comment

1
https://gitee.com/Selected-Activities/Code-relay.git
git@gitee.com:Selected-Activities/Code-relay.git
Selected-Activities
Code-relay
第 0 届 代码编故事接力赛
master

Help Search

220309 7019f5b6 1899542 220318 4015cbb9 1899542