+ 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
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);}
}
+ 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..
+ 5
i say used try catch
in side the function..
then it will not give error
+ 5
Harsh Agrawal
sure
+ 5
I will help you
+ 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.
+ 4
before learn the try catch..
you must learn.
Exception Handling..
check and uncheck Exception
+ 3
https://code.sololearn.com/cGme215wVlpr/?ref=app
Harsh Agrawal
this might help you
+ 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
+ 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
+ 2
Harsh Agrawal
while write a code..
used coment....
Its first ethic of programming
+ 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
+ 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?
+ 2
Arun Tomar what do u mean with sure??? if u just xplain me how to used so plzzz
+ 2
Arun Tomar okkk den so plzzz tell me d process how can we use try catch exception
+ 1
Arun Tomar I rewrite my code by commenting it
so now plzzz check it my code n reslove my prblm
+ 1
Gaurav Agrawal thnxxxx i got it but after i changed my program here it show exception so plzzzz resolve it
+ 1
Arun Tomar why my program show exception
+ 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
+ 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