here is my code
import javax.swing.*;
import java.text.DecimalFormat;
class method {
private static void start() {
JOptionPane.showMessageDialog(null," Area of a Circle");
String n = JOptionPane.showInputDialog(null,"Enter a Number");
int num = Integer.parseInt(n);
DecimalFormat twoDigit= new DecimalFormat("0.00");
double form1 = 3.14 * (num*2);
JOptionPane.showMessageDialog(null,"… is "+twoDigit.format(form1));
}
public static void main(String[] args) {
start();
String ipt = JOptionPane.showInputDialog("enter num");
int iptipt = Integer.parseInt(ipt);
if(iptipt==1){
method.start();
}
}}
my code is working but not the way i want. i want to display just the anz of the method start but In main in if statement "if(iptipt==1){metod.start();}"
it again calls the whole method instead of giving the specfic anz.can any any correct it
}