Question: I have a question of the java code. I am currently using netbeans IDE8.2 and I put the code package javaapplication1; /** * * @author

I have a question of the java code. I am currently using netbeans IDE8.2

and I put the code

package javaapplication1;

/** * * @author */ public class JavaApplication1 {

/** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here double radius; double PI = 3.14; System.out.println("Enter the radius : "); scanner input = new scanner(System.in); radius = input.nextDouble(); if(radius <=0){ System.out.println("The value entered for radius is invalid. Please enter a positive interger"); } else{ double area = PI*radius*radius; System.out.println("Area: "+ area); } } }

After I run the code, it says that

Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - constructor scanner in class javaapplication1.scanner cannot be applied to given types;

required: no arguments

found: java.io.InputStream

reason: actual and formal argument lists differ in length

at javaapplication1.JavaApplication1.main(JavaApplication1.java:23)

C:\Users\home\AppData\Local\NetBeans\Cache\8.2\executor-snippets un.xml:53: Java returned: 1

BUILD FAILED (total time: 5 seconds)

would u tell me how to fix?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!