Created
June 3, 2011 18:06
-
-
Save jmatt/1006820 to your computer and use it in GitHub Desktop.
And a $ back at ya.
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
package $; | |
public class $ | |
{ | |
boolean hah; | |
public $() | |
{ | |
hah = true; | |
} | |
} |
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
#### Andy Lenards favorite java one liner in action _$ $ = new $();_ | |
```javac hah.java | |
java hah | |
``` |
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
import $.$; | |
public class hah | |
{ | |
public static void main(String args[]) | |
{ | |
$ $ = new $(); // amen. | |
System.out.println("hah!"); | |
} | |
} |
This has gotta be a fun interview question for all those people who claim to "know java".
Write, compile and run a java program which creates an instance of a $ class in the $ package and then prints "hah!" to standard out.
I imagine it could be worded even better than that though... it's quite snarky because the solution is essentially trivial. It's a "can you follow directions" and "do you know the basics" sort of question. In other words: Do you ONLY know how to use Eclipse + Maven and fix bugs?!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Andy Lenards (@lenards) favorite java one liner in action $ $ = new $();