Inital Commit of simple hello world class that uses static{}

Signed-off-by: Ricky Barrette <rickbarrette@gmail.com>
This commit is contained in:
2012-03-10 23:30:40 -05:00
parent f5e306f67f
commit 9af0f52ab3
4 changed files with 72 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
/**
* Main.java
* @date Mar 10, 2012
* @author ricky barrette
* @author Twenty Codes, LLC
*/
package com.HelloWolrd;
/**
* A sime hello world class
* @author ricky barrette
*/
public class Main {
private final static String hello;
static{
hello = "Hello, "+System.getProperties().getProperty("user.name");
}
/**
* Creates a new Main
* @author ricky barrette
*/
public Main() {
assert hello != null;
System.out.print(hello);
}
/**
* @param args
* @author ricky barrette
*/
public static void main(String[] args) {
new Main();
}
}