0
最初の静的ブロックで入力値を取得できません。共通ブロック間に入力値を保存
これは私のコードです:
public static void main(String args[])throws IOException{
int i,people,timeai,tablenoai;
double iprice,timebi,tablenobi;
char decider1;
String name;
InputStreamReader read=new InputStreamReader(System.in);
BufferedReader in=new BufferedReader(read);
System.out.println("Welcome To Joel's Restaurant");
System.out.println("How Many People Do You Have?");
people=Integer.parseInt(in.readLine());
System.out.println("And May I Know Your Good Name?");
name=in.readLine();
}
public static void sleep(The_Restaurant millis) throws InterruptedException{
double timebi;
int timeai;
timebi=Math.random()*1000;
timeai=(int)timebi;
Thread.sleep(timeai);
}
public static void main(The_Restaurant args[])throws IOException{
int tablenoai;
double tablenobi;
tablenobi=Math.random()*10;
tablenoai=(int)tablenobi;
System.out.println("Mr."+name+"Table For"+people+"Your Table No Is"+tablenoai);
}
はそれを行うための方法はありますか?
あなたはそれぞれ、すべての単語を大文字にしてはいけません。 「あなたが他の誤りに気付いた場合」のような文章は良い質問ではありません。適切な字下げを行うようにコードを書式化してください。 –
「あなたの良い名前を知っていますか?」中世のパロディーレストランのアプリですか?多分現代英語のチュートリアルをチェックしてください。彼らがこれまでにしたことがないなら、誰も約300年ほど話したことはありません。 – ADyson