在java中找不到类命令的错误消息

时间:2017-05-08 05:44:14

标签: java

import java.util.*;
class Example {
    public static void main(String args[]) {
       Scanner input = new Scanner(System.in);
       System.out.print("number of rooms:");
       int rooms = input.nextInt();
       int count = 0;
       for(int i = 0; i < rooms; i++) {
           System.out.print("room capacity-q:");
           int q = input.nextInt();
           System.out.print("current space of the room-p:");
           int p = input.nextInt();
           if ((q - p) >= 2) {
               count += 1;
           }
       }
       System.out.println("no.rooms for thusitha & chamod is:"+count);
    }
}

我收到一个名为class not error的错误。想知道是什么原因。

0 个答案:

没有答案