Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from ggarlic/master
added: shell and java version
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
function _42(){ | ||
return 42 | ||
} | ||
|
||
_42 "life" "universe" "everything" | ||
answer=$? | ||
echo $answer |