r/programminghelp • u/QuietProphet46-2 • Apr 24 '21
Java Confused calling on classes/methods from other .java files
Working in NetBeans, using Java. Teacher assigned source code file to not be altered, with 2 other files that should be created in order for the first code file to run. I've created the other two codes, but the issue I'm having is the instantiation of 2 objects in the main source code. It is acting like the latter 2 source code files are not in the package, therefore the first code will not run. I've looked over some forums, but can't figure out why this is happening. I have moved my classes to the correct package, but still it says "Cannot find symbol".
Please help
4
Upvotes
2
u/[deleted] Apr 24 '21
You're going to have to post some code here because under sane conditions, classes in local java files should just be picked up. So either netbeans is doing something *special* like the 2nd rate IDE that it is, or there's a problem with the code. Have you tried using the javac and java commands from the commandline to check compilation, etc?