BAEL-3929: added another example per code review.
This commit is contained in:
		
							parent
							
								
									dcb65ba8bc
								
							
						
					
					
						commit
						b14ab5ed7a
					
				| @ -6,6 +6,7 @@ import java.util.Map; | |||||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||||
| 
 | 
 | ||||||
| public class Main { | public class Main { | ||||||
|  | 
 | ||||||
|     public static void main(String[] args) { |     public static void main(String[] args) { | ||||||
|         Map<String, String> map = new HashMap<>(); |         Map<String, String> map = new HashMap<>(); | ||||||
|         map.put("Dallas", "Texas"); |         map.put("Dallas", "Texas"); | ||||||
| @ -15,4 +16,5 @@ public class Main { | |||||||
|         LoggerFactory.getLogger(Main.class) |         LoggerFactory.getLogger(Main.class) | ||||||
|             .info("Map: {}", map); |             .info("Map: {}", map); | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
| } | } | ||||||
|  | |||||||
| @ -0,0 +1,15 @@ | |||||||
|  | package com.baeldung; | ||||||
|  | 
 | ||||||
|  | public class ReflectionMain { | ||||||
|  | 
 | ||||||
|  |     public static void main(String[] args) { | ||||||
|  |         ClassLoader classLoader = Main.class.getClassLoader(); | ||||||
|  |         try { | ||||||
|  |             System.out.println(classLoader.loadClass("org.apache.commons.collections.CollectionUtils") | ||||||
|  |                 .getSimpleName()); | ||||||
|  |         } catch (ClassNotFoundException e) { | ||||||
|  |             e.printStackTrace(); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | } | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user