Question: Assume that we have the following java code NewCircle.java: 1 public class NewCircle [ 2 int radius = 5 ; 3 double = 3 .
Assume that we have the following java code NewCircle.java:
public class NewCircle
int radius ;
double ;
public static void mainString arg
int radius;
sum;
public void sum
double valperimeterradius;
System.out.printinval;
public double perimeterint
retum double pi :;
Save the file as NewCircle.java, compile it
Identify how many syntax errors you are getting. point
Assume that there are two syntax errors. Provide the line numbers of both syntax errors. points
For line say provide in details the syntax error that is taking place. points
For line say y provide in details the syntax error that is taking place.
The code can be fixed by creating an object nc of the class NewCircle as follows:
NewCircle nc new NewCircle;
identify the line at which you will place the above code.
use nc to modify the above code so the lines that are causing the errors in and are fixed.
Provide the value of val. Save the file that contains the corrected code as NewCriclejava. Submit the code under: LastNameFirstNameNewCirclejava.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
