Skip to content

Instantly share code, notes, and snippets.

System.out.println("Hello World");
System.out.println("Hello World");
System.out.println("Hello World");
System.out.println("Hello World");
@kmb385
kmb385 / jist.java
Created November 1, 2012 14:33
Example Java
public void showBen(){
System.out.print("SHow Ben Gist");
}
@kmb385
kmb385 / gist:5998632
Created July 15, 2013 09:27
This is an example for StackOverflow to help someone resolve a GSON issue.
import java.lang.reflect.Type;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
public class MapData {
private int id;
private String city;
private String street;
public class ThreadSafety implements Runnable {
public Integer i = 0;
@Override
public void run() {
try {
increment(this);
increment2();
@kmb385
kmb385 / gist:7681956
Created November 27, 2013 19:43
Array with component type that is a parameterized type
public class ArrayStoreCheck {
/**
* @param args
*/
public static void main(String[] args) {
LinkedList integers = new LinkedList<Integer>();
integers.add(1);
LinkedList<String> strings = new LinkedList<String>();
LinkedList<String>[] lists = new LinkedList[20];
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
public class Student {
@kmb385
kmb385 / MyApp.java
Created January 15, 2014 01:44
Simple Spring Injection with @resource
package com.test;
import javax.annotation.Resource;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class MyApp {
@Resource(name="myBean")