Skip to content

Commit

Permalink
Merge pull request #9 from ggarlic/master
Browse files Browse the repository at this point in the history
added: shell and java version
  • Loading branch information
zhuangya committed Dec 2, 2014
2 parents b144438 + 6b900e2 commit f97ecde
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
29 changes: 29 additions & 0 deletions _42.java
@@ -0,0 +1,29 @@
public class _42{
public static final int answer = 42;

private int theAnswer = 0;

private int getTheAnswer(){
return theAnswer;
}

private void setTheAnswer(int answer){
this.theAnswer = answer;
}

public int getTheAnswerToLifeTheUniverseAndEverythingElse(String...params){
return getTheAnswer();
}
public static void main(String[] args) {
_42 __42 = new _42();
__42.setTheAnswer(answer);
try{
System.out.println(
__42.getTheAnswerToLifeTheUniverseAndEverythingElse(
"Life", "Universe", "Everything Else"));
}catch (Exception e){
System.out.println(answer);
}

}
}
8 changes: 8 additions & 0 deletions _42.sh
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
function _42(){
return 42
}

_42 "life" "universe" "everything"
answer=$?
echo $answer

0 comments on commit f97ecde

Please sign in to comment.