+ 1

Plzzz help me to find out my error!!!! I check out my code many time but i didnt get d error so plzzz help me

here is the code https://code.sololearn.com/ca3cePWKSnc6/?ref=app Gaurav Agrawal Arun Tomar Fata1 Err0r

4th Jun 2018, 4:33 PM
Harsh Agrawal
Harsh Agrawal - avatar
20 Réponses
+ 24
//give 4 user inputs ... acc_no,unknown,title,author //errors were of bracket , syntax + some logical error too //👉go through the java lesson again with examples , will be helpful import java.util.Scanner; public class GauravProgram{ public static void main(String ...args){ Scanner sc=new Scanner(System.in); int acc_no=sc.nextInt(),d=sc.nextInt(); //accn no, unknown //here days (...9) are not used , might some logical error. String title=sc.next(),author=sc.next(); //title,author System.out.print("fine = "+(d*2)+"\naccn_no\t"+acc_no+"\ntitle\t"+title+"\nauthor\t"+author);} }
4th Jun 2018, 5:26 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 5
i dont thing so.. this app is working fine. before executive the code. thia app required input.. .. if we by mistakes done something worng while enter the input.. it show us NumberFormatExCeption..
5th Jun 2018, 4:01 AM
Arun Tomar
Arun Tomar - avatar
+ 5
i say used try catch in side the function.. then it will not give error
5th Jun 2018, 4:10 AM
Arun Tomar
Arun Tomar - avatar
5th Jun 2018, 4:14 AM
Arun Tomar
Arun Tomar - avatar
+ 5
I will help you
5th Jun 2018, 4:17 AM
Arun Tomar
Arun Tomar - avatar
+ 4
There is nothing wrong with your program. but the problem is. NumberFormatException.. come if you run this program.. in your pc it work fine... i also little change in your program.. you call ob.compute(9) give body to function but not use the parameter in the coding.
5th Jun 2018, 3:51 AM
Arun Tomar
Arun Tomar - avatar
+ 4
before learn the try catch.. you must learn. Exception Handling.. check and uncheck Exception
5th Jun 2018, 4:14 AM
Arun Tomar
Arun Tomar - avatar
4th Jun 2018, 6:27 PM
Arun Tomar
Arun Tomar - avatar
+ 3
Arun Tomar so it wll run in pc but why it is not work in this app any technical problem in this app or in my program
5th Jun 2018, 3:59 AM
Harsh Agrawal
Harsh Agrawal - avatar
+ 3
https://www.javatpoint.com/try-catch-block this help you understand try and catch and https://www.tutorialspoint.com/java/java_exceptions.htm this will help you in exception handling
5th Jun 2018, 9:36 AM
Arun Tomar
Arun Tomar - avatar
+ 2
Harsh Agrawal while write a code.. used coment.... Its first ethic of programming
4th Jun 2018, 5:11 PM
Arun Tomar
Arun Tomar - avatar
+ 2
Arun Tomar i m not saying that ur program is not running but i just want to ask where is the falut in my program???? why it show exception
5th Jun 2018, 3:48 AM
Harsh Agrawal
Harsh Agrawal - avatar
+ 2
Arun Tomar can u xplain me try catch method i dont know much about try catch what does it mean? how is it useful? how can we used it?
5th Jun 2018, 4:12 AM
Harsh Agrawal
Harsh Agrawal - avatar
+ 2
Arun Tomar what do u mean with sure??? if u just xplain me how to used so plzzz
5th Jun 2018, 4:16 AM
Harsh Agrawal
Harsh Agrawal - avatar
+ 2
Arun Tomar okkk den so plzzz tell me d process how can we use try catch exception
5th Jun 2018, 4:17 AM
Harsh Agrawal
Harsh Agrawal - avatar
+ 1
Arun Tomar I rewrite my code by commenting it so now plzzz check it my code n reslove my prblm
4th Jun 2018, 5:27 PM
Harsh Agrawal
Harsh Agrawal - avatar
+ 1
Gaurav Agrawal thnxxxx i got it but after i changed my program here it show exception so plzzzz resolve it
4th Jun 2018, 5:41 PM
Harsh Agrawal
Harsh Agrawal - avatar
+ 1
Arun Tomar why my program show exception
5th Jun 2018, 1:39 AM
Harsh Agrawal
Harsh Agrawal - avatar
+ 1
Arun Tomar it wll work when i use bufferedReader as global but when i used inside a function it shows error when i used in two function
5th Jun 2018, 4:03 AM
Harsh Agrawal
Harsh Agrawal - avatar
+ 1
Arun Tomar bro but can u also xplain me in ur own lanuage so i can understand properly BTW this link is gud to underatand try catch block
5th Jun 2018, 10:55 AM
Harsh Agrawal
Harsh Agrawal - avatar