Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

how to slove class not found problem

+11 votes
asked May 22 by Vamsi Kiran (220 points)

1 Answer

+1 vote
answered May 23 by Peter Minarik (88,520 points)

It's a very broad question. You should specify your language, add some context. Better yet, share your code that is causing the problem.

So, for a broad question, a generic answer is all we can provide. If a class is not found, you make sure of the following:

  • the code looking for the class (and not finding it) knows about it. Make sure you have your class declaration (in top-down reading of your code) before you use it. Some languages do not require this.
  • you do not have a typo in your class name (neither in the declaration, definition nor using it).
  • the class name is fully qualified (with namespace, or the namespaces are referenced/used for shortcuts) -- not all languages have namespaces or could be called differently, e.g. packages.
  • linking happens correctly -- subject to specific languages.
  • you use an instance where instance members are accessed and the class where static members are accessed

Please, share your code for more personalized answers to your problem.

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...