#Error Cannot Find Symbol

1 messages ยท Page 1 of 1 (latest)

serene lotusBOT
#

<@&987246399047479336> please have a look, thanks.

#

I uploaded your attachments as Gist.

#

Here is an AI assisted attempt to answer your question ๐Ÿค–. Maybe it helps! In any case, a human is on the way ๐Ÿ‘. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.

#
TJ-Bot
When i am running main file i am getting error for cannot find sumbol Withdraw and Deposit . Can anyone tell me why it is occuring?

The error "cannot find symbol" typically occurs when the compiler cannot find a particular class, method, or variable that is being referenced in the code. In this case, it seems like the compiler is unable to find the classes or methods named "Withdraw" and "Deposit" in your main file.

There are a few common reasons why this error may be occurring:

  1. Missing import statement: Make sure that you have imported the classes that contain the "Withdraw" and "Deposit" methods in your main file. If these classes are not in the same package or are from external libraries, you need to import them using the import statement.

  2. Incorrect package name: If the classes containing the "Withdraw" and "Deposit" methods are in a different package than your main file, make sure that you have specified the correct package name when importing them.

  3. Typo or misspelling: Check for any typos or misspellings in the names of the classes or methods. The names must match exactly as they are defined in their respective files.

By addressing these potential issues and ensuring that the necessary classes and methods are correctly imported and referenced in your main file, you should be able to resolve the "cannot find symbol" error for "Withdraw" and "Deposit".

idle thunder
#

Thanks I have found solution for the querry

tardy zealot
#

you could use reentrantreadwritelock for the account btw

idle thunder
#

acctually i am learning multithreading i have yet to read about it. But thanks for the advice.

tardy zealot
#

synchronized is fine usually, but sometimes it can be a bit slow especially if there is a lot of reads

#

then every thread has to wait for others to release instead of everyone reading it at once because its a readlock