Mega Code Archive

 
Categories / Java Tutorial / Reflection
 

Create new instance

public class StringTest {     public static void main(String[] args) {         try {             String pc = String.class.newInstance();         } catch (InstantiationException e) {             e.printStackTrace();         } catch (IllegalAccessException e) {             e.printStackTrace();         }     } }