Skip to content

Instantly share code, notes, and snippets.

@ryangreenberg
Last active March 1, 2016 21:16
Show Gist options
  • Save ryangreenberg/3a2d40ee5b6c443abf62 to your computer and use it in GitHub Desktop.
Save ryangreenberg/3a2d40ee5b6c443abf62 to your computer and use it in GitHub Desktop.
The `java` Challenge

The java challenge

  1. Download the following two files: Main.java and Helper.java (this is the easy part).
  2. Compile these files on the command line.
  3. Run Main to produce the output "Hello, World!"

Scoring

  • You are able to run Main: 1 point
  • You are not able to run Main: 0 points

Bonus points

  • You do not consult any resources on the Internet: 1 point
  • You run Main from a JAR: 1 point
package com.example.bar;
public class Helper {
static public String greet(String thing) {
return "Hello, " + thing + "!";
}
}
package com.example.foo;
import com.example.bar.Helper;
class Main {
public static void main(String [] args) {
System.out.println(Helper.greet("World"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment