Quote:
I am trying my best from the past few days. But I am not getting the solution. I got many errors which are variable not defined, can't use static/private classes, IOException. That's why I come to the conclusion to get some help.
So start by fixing the errors.
Look at each error message in turn: it will tell you the file name, the line number, (probably) the column on which iut found the problem, and an error message to describe what is wrong.
Most editors support CTRL+G to go directly to a line number, and if you are using an IDE, then almost certainly double clicking the error message will take you straight to the line itself.
Then look at the message - it tells you roughly what the problem is.
"Undefined variable" - that's pretty obvious: a variable with that name does not exist, or does does not exist in the current scope. Check you typed the name the same as you did when you declared it - indeed, check you declared it at all!
Check that the declaration is "in scope" - if
x
is defined inside function
foo
then it is only available within that function: you can't use it in function
bar
unless you pass it to it via a parameter.
A spurious close curly bracket can cause this as well, because it "ends the scope" and stops variables declared in the code it closes being available any more.
When you think you have fixed an error, compile again - many errors can be caused by previous problems, so getting rid of one problem can remove several errors. And always start from the first one - the others may be caused by the same problem!
We can't see your screen, we can't see your error messages - and we can't compile your code to see what they might be!
So stop panicking, and think about each error in isolation.