现在的位置: 首页 > 综合 > 正文

虽然是程序员,也要找点快乐啊—代码中的秘密,欢迎大家修改或者提出自己的想法

2013年08月19日 ⁄ 综合 ⁄ 共 633字 ⁄ 字号 评论关闭

public class Myself {
 public static void main(String[] args){
  System.out.println("Whatever you speak ,you select it!");
  System.out.println(makeDecision(makeItByGod()));
  //my decision is this
  new Heart().hideMySecret(makeDecision(false));
 }
 public static String makeDecision(boolean isSpeakToHer){
  if(isSpeakToHer == true){
   return "Maybe we won't see or i don't know what will happen!";
  }else{
   return "Maybe it's my secret for ever!  ";
  }
   }
 
 public static  boolean makeItByGod(){ //help you to make a decision
  if(Math.random() > 0.5d){
   return true;
  }else
   return false;
 }
 
}

class Heart{
 private String mySecret;
 public void hideMySecret(String decision){
  mySecret = decision;
 }
}

抱歉!评论已关闭.