Html代码:
<table>
<tr>
<td>The first row</td> <td>The first row</td>
</tr>
<tr>
<td>The second row</td> <td>The second row</td>
</tr>
<tr>
<td>The third row</td> <td>The third row</td>
</tr>
<tr>
<td>The forth row</td> <td>The forth row</td>
</tr>
</table>
<hr>
<table>
<tr>
<td>The first row</td> <td>The first row</td>
</tr>
<tr>
<td>The second row</td> <td>The second row</td>
</tr>
<tr>
<td>The third row</td> <td>The third row</td>
</tr>
<tr>
<td>The forth row</td> <td>The forth row</td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)
jQuery代码:
$(function () {
$("table:first tr").css("background", "#ffbbbb"); //work
$("table:last>tr").css("background", "#ffbbbb"); …Run Code Online (Sandbox Code Playgroud) 我们都知道,关闭我们在代码末尾定义的所有 StreamReader 是一个好习惯。
现在我们可以看到两个 Reader 的定义如下。BufferedReader 和InputStreamReader。BufferedReader 已关闭,但我们无法关闭InputStreamReader。
JAVA代码:
BufferedReader in = new BufferedReader(new InputStreamReader(
connection.getInputStream()));
if (in != null) {
in.close();
}
Run Code Online (Sandbox Code Playgroud)
问题来了,括号里的InputStreamReader是否应该关闭呢?这样的代码会不会给程序带来一些问题呢?请告诉我,谢谢~