public static void main(String[] args) {
		try {
			String cla = "java.util.Calendar";
			String method = "getInstance";
			String param = "2.5";
			Class<?> c = Class.forName(cla);
			//System.out.println(Arrays.toString(c.getMethods()));
			Method[] methods = c.getMethods();
			boolean called = false;
			for (int i = 0; i < methods.length; i++) {
				Method m = methods[i];
				if (m.getName().equals(method)) {
					try {
						m.setAccessible(true);
						System.out.println(m.invoke(c.newInstance()));
						System.out.println(m.invoke(new Object(), Double.parseDouble(param)));
						called = true;
						break;
					} catch (Exception e) {
						System.err.println("Something went wrong calling the method: " + m.toString());
						e.printStackTrace();
					}
				}
			}
			if (!called) {
				System.err.println("Could not call method.");
			}
			
			//Method m = c.getMethod(method, new Class[] {Object.class});
			//System.out.println(m.invoke(c.newInstance(), param));
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (IllegalArgumentException e) {
			e.printStackTrace();
		} catch (SecurityException e) {
			e.printStackTrace();
		}
		
		
	}