这有错误ㅠㅠ 错误
错误!! 强调文字 dkdkd
import java.util.*;
public class SetExam {
public static void main(String[] args) {
Set<String>set = new HashSet<String>();
set.add("a");
set.add("b");
Iterator<String> iter = set.iterator();
While(iter.hasNext()){ //this point it's error
String str = iter.next();
System.out.println(str);
}
}
虽然~~这有错误,为什么不正确?
答案 0 :(得分:1)
原因是因为你使用大写w而不是小写w
function Test-Port
{
param
(
$Address,
$Port
)
$tcpClient = new-object Net.Sockets.TcpClient
try
{
$tcpClient.Connect("$Address", $Port)
$true
}
catch
{
$false
}
finally
{
$tcpClient.Dispose()
}
}
Test-Port -Address localhost -Port 80
Test-Port -Address localhost -Port 81
而不是
while(true){/*do something*/}