Exception in thread "main" java.lang.NullPointerException at lab2.Test.main(Test.java:23)
package lab2;
import java.io.Console;
public class Test {
    public static void main(String []args) {
        Console cnsl = null;
        String  payload = null;
        // creates a console object
        cnsl = System.console();
        // read line from the user input
        its a run time error , it shows the null exception 
        payload = cnsl.readLine("Enter weight of the payload in lb: ");
        // prints
        pay = Float.parseFloat(payload);;
read line from the user input double hello = ((8 * pay * POUNDINKILO * ACCELERATION_GRAVITY)/(PI * ROWDENSITY * 0.75 * VOLUME * VOLUME));
        D = Math.sqrt(hello);
        System.out.println("For a payload of : " + payload);
        System.out.println("\nFor a payload of : " + payload);
        System.out.println("Radius is : " + D);
    }
}
 
     
     
     
    