所以每当我构建和测试我的maven包时,我都没有得到输出并且程序自动关闭,我在Eclipse和Netbeans上尝试了这个并且仍然没有注意,提前感谢并且代码如下:
public static void main(String[] args) {
// TODO Auto-generated method stub
Boolean end = false;
while(end = false){
System.out.println("Enter your command(for list of commands press h): ");
Scanner scanner = new Scanner(System.in);
String command = scanner.nextLine();
if(command == "h"){
System.out.println("start starts basic program");
System.out.println("start1 starts twitter based program(in development)");
System.out.println("api sets api");
System.out.println("time sets check time");
}else if( command == "start"){
mainmethod();
}else if(command == "time"){
}else if( command == "end"){
end = true;
}
}
}
答案 0 :(得分:0)
您的代码意味着:
// prepare and bind
$sql="INSERT INTO creatcontact (email, subject, mobileno) VALUES (?,?,?)";
$stmt = $conn->prepare($sql);
$stmt->bind_param("ssi",$email, $subject, $mobileno);
$stmt->execute();
//redirect code
header('Location: index.php');
$stmt->close();
$conn->close();
请改变:
while(false){.....}
进入:
while(end = false){
......
}
答案 1 :(得分:0)
它是“==”而不是“=”。end == false