在中国程序媛中,他们的代码有什么样的魅力,Aone联合云栖社区、饿了么、钉钉、阿里云、天猫、口碑发起首届程序媛比码活动——不秀大长腿,秀高智商;不秀美图照,秀代码图,参与晒码互动游戏赢“83行代码”T恤!
我们来说说这群女工程师的第83行代码及代码背后的故事:
听说程序媛这个物种十分罕见,我是作为罕见中的一员happy(被)来(逼)的,毕业几年的人生感悟:每个人在浩瀚的宇宙中都有自己独特的坐标,这个坐标会因为你的选择而变的不同,同样这个世界也会因为你坐标的移动而变得不同!SO,COME ON 加入我们,让我们一起改变世界,成就更好的自己!我在tmall一直等你!caiyue@tmall.com
![79ff74925e3f9a0e6bdc0bc6f98cfdb10c418bee]()
package tmall;
import lombok.*;
/**
- Created by caiyue on 2018/7/16.
*/
@AllArgsConstructor
class Business {
private String buName, salary, awardMoney, mission, colleague;
public Person change(Person p) {return p;}
public String toString() {
return buName + "公司:[工资:" + salary + ",奖金:" + awardMoney + ",同事:" + colleague + ",使命:" + mission + "]";
}
}
@Data
@AllArgsConstructor
class Person {
private String role, x, y, z;
public String toString() {return role + ":[" + x + "、" + y + "、" + z + "]";}
}
class TmallBu extends Business {
public TmallBu(String buName, String salary, String awardMoney, String misson, String colleague) {
super(buName, salary, awardMoney, misson, colleague);
}
public Person change(Person p) {
switch (p.getRole()) {
case "程序媛":
return new Person(p.getRole(), "人美", "码赞", "会生活");
case "程序员":
return new Person(p.getRole(), "人帅", "钱多", "疼老婆");
default:
return new Person(p.getRole(), "坐标丢失", "坐标丢失", "坐标丢失");
}
}
public class TransformAll {
public static void main(String[] args) {
Business tmall = new TmallBu("天猫", "五颗星", "五颗星", "改变自己改变世界", "一群有情有义的人");
Person ordinaryGirl = new Person("程序媛", "定位自我", "找寻理想", "探索生活意义");
Person tmallProgrammerGirl = tmall.change(ordinaryGirl);
System.out.println(tmall.toString());
System.out.println(tmallProgrammerGirl.toString());
System.out.println("欢迎来天猫一起成为更好的自己!");
}
}
与采月小姐姐互动,为她打call——>点击进去采月晒码