开发者

Cannot find symbol?

When I try to compile my code I am getting the error:

1 error found:

File: C:\Users\Matthew\Documents\engr 103\cpu.java [line: 13]

Error: C:\Users\Matthew\Documents\engr 103\cpu.java:13: cannot find symbol

symbol : class BufferReader

location: c开发者_高级运维lass cpu

I've been trying to fix this for a while now, but it's been a while since I used Java, and I have no idea what to do.

import java.io.*;
import java.util.Scanner;



 class cpu{
  public static void main(String []args) throws Exception
  {
    Runtime r =Runtime.getRuntime();

      String f,temp,res="";
      int i=0,j=0;
      f="sensors";
      Process p=r.exec(f);
      BufferedReader pin=new BufferReader(new InputStreamReader(p.getInputStream()));
      while((temp=pin.readLine())!=null)
      {
        System.out.println(temp);
      }
  }
}


You misspelled 'BufferedReader' as 'BufferReader' on line 13.

BufferedReader pin = new BufferReader(new InputStreamReader(p.getInputStream()));

Needs to be...

BufferedReader pin = new BufferedReader(new InputStreamReader(p.getInputStream()));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜