package com.gochinatv.cdn.api.basic.normal;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ClassForNameTest {
  
	static{
		System.out.println("执行static代码块");
	}
	
	public ClassForNameTest(){
		System.out.println("执行构造方法");
	}
	
	public static void main(String[] args) {
		
		
		try {
			/**
			 * 这里会执行static静态代码块,不会执行构造方法
			 */
			Class.forName("com.gochinatv.cdn.api.basic.normal.ClassForNameTest");
			Class.forName("com.mysql.jdbc.Driver");
		} catch (ClassNotFoundException e1) {
			e1.printStackTrace();
		}
		//String s1="zhuhu";
		//String s2="zhu"+"hu";
		//System.out.println(s1==s2);
		//System.out.println(s1==s1.intern());
		try {
			Connection con = DriverManager.getConnection("","","");
		} catch (SQLException e) {
			e.printStackTrace();
		}  
	}
}

@@ -287,32 +287,98 @@
 %E6%9E%84%E9%80%A0%E6%96%B9%E6%B3%95%22);%0D%0A%09%7D%0D%0A%09%0D%0A
+%09public void index()%7B%0D%0A%09%09System.out.println(%22%E6%89%A7%E8%A1%8Cindex%E6%96%B9%E6%B3%95%22);%0D%0A%09%7D%0D%0A%09%0D%0A
 %09public static v
@@ -544,16 +544,313 @@
 est%22);%0D%0A
+%09%09%09%0D%0A%09%09%09Class%3C?%3E clazz = Class.forName(%22com.gochinatv.cdn.api.basic.normal.ClassForNameTest%22);%0D%0A%09%09%09try %7B%0D%0A%09%09%09%09/**%0D%0A%09%09%09%09 * %E6%89%A7%E8%A1%8C%E6%9E%84%E9%80%A0%E6%96%B9%E6%B3%95%0D%0A%09%09%09%09 */%0D%0A%09%09%09%09ClassForNameTest forname = (ClassForNameTest)clazz.newInstance();%0D%0A%09%09%09%09forname.index();%0D%0A%09%09%09%7D catch (Exception e) %7B%0D%0A%09%09%09%09e.printStackTrace();%0D%0A%09%09%09%7D%0D%0A%09%09%09%0D%0A
 %09%09%09Class
@@ -976,13 +976,13 @@
 s1=%22
-zhuhu
+jackt
 %22;%0D%0A
@@ -1000,16 +1000,16 @@
 s2=%22
-zhu%22+%22hu
+jack%22+%22t
 %22;%0D%0A
@@ -1039,16 +1039,22 @@
 s1==s2);
+//true
 %0D%0A%09%09//Sy
@@ -1087,16 +1087,22 @@
 tern());
+//true
 %0D%0A%09%09try 

添加Class.forName 测试