title: What if "T" not defined in code?
body: <p>this is the code I have so far. Which converts map to object and runs as expected with no error.</p>
  
  <p>But I have a question about how to generic works. Any replay will be appreciated.</p>
  
  <p><strong>1. Why no error occurs although no generic 'T' is defined in the method or in the middle of the code?</strong></p>
  
  <p><strong>2.  <code>&lt;T&gt;</code> in the method is like the indicator which informs the compile that this method uses character T as generic? My understanding is right?</strong></p>
  
  <pre><code>public static &lt;T&gt; T convertMapToObject(Map&lt;String, Object&gt; map, Object obj){
  
                try {
                  Iterator&lt;String&gt; keyIter = map.keySet().iterator();
  
                  Method[] methods = obj.getClass().getMethods();
                  while(keyIter.hasNext()){
                      String key = keyIter.next(); 
                      String methodName = "set" + StringUtils.capitalize(key);
                      for(int i=0; i&lt;methods.length; i++){
                          if(methodName.equals(methods[i].getName())){
  
  
                              Class&lt;?&gt; clazz = methods[i].getParameterTypes()[0]; //메서드 인수 타입
                              if (String.class == clazz){
                                  methods[i].invoke(obj, String.valueOf(map.get(key)));
                              }
                              else {
                                  methods[i].invoke(obj, map.get(key));
                              }
                              break;
                          }
                      }
                  }
                   return (T)obj;
                } catch (Exception e) {
                   e.printStackTrace(); 
                  log.error(e);
              } 
            return null;
      }
  ---------------------------
          FileEx f= convertMapToObject(map, fileEx);
  </code></pre>