import java.io.DataInputStream;

class Reading{

    public static void main(String ar[]) throws Exception {
        DataInputStream din = new DataInputStream(System.in);

        int intNumber = 0;
        float floatNumber = 0.0f;

        System.out.println("Enter integer and float number");

        intNumber = Integer.parseInt(din.readLine());
        floatNumber = Float.valueOf(din.readLine()).floatValue();

        System.out.println("Integer" + intNumber);
        System.out.println("Float" + floatNumber);
    }
}

/* Output

Note: Reading.java uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

*/

最佳答案

您实际上编译正常。由于您似乎使用了一些过时的API,因此输出包含一些警告。

10-02 06:57