Null Pointer Exception in Shipping Calculator. For JAVA and KOTLIN experts...
From nowhere this error is getting popped up for me. Kindly help me overcome this: CODE:- fun shippingCost(amount: Double, international: Boolean): Double { var a: Double if(international==true) { if(amount>=75.0) { a=amount*0.15 if(a>50.0) { a=50.0 return a } else { return a } } } if(amount>=75.0 && international==false) { a=0.0 return a } else { a=amount/10.0 return a } return 0.0 } fun main(args: Array<String>) { val total = readLine()!!.toDouble() val international = readLine()!!.toBoolean() println(shippingCost(total, international)) } ERROR:- Exception in thread "main" java.lang.NullPointerException at File0Kt.main(file0.kt:33)