Error in System.out.println

前端 未结 5 1507
独厮守ぢ
独厮守ぢ 2021-01-24 14:59

Is there any error in the following code? It shows cant find symbol, symbol: class out location: class System. In the log, it show a lot of errors, including

java.lang.

5条回答
  •  隐瞒了意图╮
    2021-01-24 15:13

    You are missing the java basics.

    Problem:

    Processing statements should be in function only.

    Solution:

    Scanner sc=new Scanner(System.in);
    System.out.println("Enter the value of r");
    int r=sc.nextInt();
    System.out.println("enter the value h");
    int h=sc.nextInt();
    

    Post the above code either in function or constructor by doing changes according to your requirements.

提交回复
热议问题