String sqlrightDate = " select state from right where user_id = '%s' and soft_code ='%s'
and right_name = '%s' " ;
String str = String.format(sqlrightDate, " 1 " ,"2" );
System.out.println(str);
错误的写法: String str = String.format(sqlrightDate, " 1 " );
描述:
Not enough arguments are passed to satisfy a placeholder in the format string. A runtime exception will | |||||||||||||||||||||||||||||||||||||||
occur when this statement is executed. |