请问我这段代码哪里出问题了?
package com.practice;
import java.util.Scanner;
//本程序用于练习try——catch块语句
public class HelloWorld{
public static void main(String[] args){
try{
Scanner input = new Scanner(System.in);
int num = input.nextInt();
}
catch(InputMismatchException e){
System.out.println("请输入整数!");
}
}
}